美文网首页
CryptoSwift vs SAMKeychain

CryptoSwift vs SAMKeychain

作者: rajs20222007 | 来源:发表于2018-11-17 21:14 被阅读0次

    不知道什么本质区别?反正都可以用户保持keychain数据。

    关于SAMKeychain

    1. return SAMKeychain.password(forService: Keys.service, account: Keys.account)
    2. SAMKeychain.deletePassword(forService: Keys.service, account: Keys.account)
    

    关于CryptoSwift
    Swift - 第三方加密库CryptoSwift使用详解1(数据类型转换、MD5、SHA)
    https://www.hangge.com/blog/cache/detail_1865.html

    Swift - 第三方加密库CryptoSwift使用详解2(CRC、MAC、PBKDF2)
    https://www.hangge.com/blog/cache/detail_1867.html

    例子:

    1. keychain.set(timeString, forKey: autoLockTime)
        keychain.set(String(type.rawValue), forKey: autoLockType)
    
    2. let timeString = keychain.get(autoLockTime)
    
    3. keychain.delete(passcodeAttempts)
    
    4. func save(cookies: [HTTPCookie]) {
            let data = NSKeyedArchiver.archivedData(withRootObject: cookies)
            keychain.set(data, forKey: cookiesKey)
        }
    let encodedData = keychain.getData(cookiesKey)
    

    相关文章

      网友评论

          本文标题:CryptoSwift vs SAMKeychain

          本文链接:https://www.haomeiwen.com/subject/oqwifqtx.html