Compare commits
3 Commits
53ac2c7001
...
560efd2c8b
| Author | SHA1 | Date | |
|---|---|---|---|
| 560efd2c8b | |||
| 7e24bdf3d5 | |||
|
|
5df2499c4a |
@@ -23,29 +23,37 @@
|
||||
import Foundation
|
||||
import LCECryptoKit
|
||||
|
||||
public final class LCECrypto {
|
||||
public final class LCECryptoKitManager {
|
||||
|
||||
private let hashKey: String
|
||||
|
||||
init(privateKey: String){
|
||||
public init() {
|
||||
self.hashKey = ""
|
||||
}
|
||||
|
||||
public init(privateKey: String){
|
||||
self.hashKey = privateKey
|
||||
}
|
||||
|
||||
func encodeTP(email: String, password: String) -> String? {
|
||||
public static func generateKey() -> String {
|
||||
LCECryptoKit.generateRandomAESKeyString()
|
||||
}
|
||||
|
||||
public func encodeTP(email: String, password: String) -> String? {
|
||||
return LCECryptoKit.encodeSeed(email: email, password: password)
|
||||
}
|
||||
|
||||
func decodeOTP(_ otpHash: String) -> String? {
|
||||
public func decodeOTP(_ otpHash: String) -> String? {
|
||||
return LCECryptoKit.decodeSeed(otpKey: otpHash)
|
||||
}
|
||||
|
||||
// MARK: Need hashKey to decode
|
||||
|
||||
func encodeOTPWithKey(email: String, password: String) -> String? {
|
||||
public func encodeOTPWithKey(email: String, password: String) -> String? {
|
||||
return LCECryptoKit.encodeSeed(email: email, password: password, hashKey: self.hashKey)
|
||||
}
|
||||
|
||||
func decodeOTPWithKey(_ otpHash: String) -> Bool {
|
||||
public func decodeOTPWithKey(_ otpHash: String) -> Bool {
|
||||
LCECryptoKit.decodeSeed(otpKey: otpHash, hashKey: self.hashKey)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user