Added more options
This commit is contained in:
@@ -23,29 +23,37 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
import LCECryptoKit
|
import LCECryptoKit
|
||||||
|
|
||||||
public final class LCECrypto {
|
public final class LCECryptoKitManager {
|
||||||
|
|
||||||
private let hashKey: String
|
private let hashKey: String
|
||||||
|
|
||||||
init(privateKey: String){
|
public init() {
|
||||||
|
self.hashKey = ""
|
||||||
|
}
|
||||||
|
|
||||||
|
public init(privateKey: String){
|
||||||
self.hashKey = privateKey
|
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)
|
return LCECryptoKit.encodeSeed(email: email, password: password)
|
||||||
}
|
}
|
||||||
|
|
||||||
func decodeOTP(_ otpHash: String) -> String? {
|
public func decodeOTP(_ otpHash: String) -> String? {
|
||||||
return LCECryptoKit.decodeSeed(otpKey: otpHash)
|
return LCECryptoKit.decodeSeed(otpKey: otpHash)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: Need hashKey to decode
|
// 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)
|
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)
|
LCECryptoKit.decodeSeed(otpKey: otpHash, hashKey: self.hashKey)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user