【问题标题】:Decodable to JSON Swift 4可解码为 JSON Swift 4
【发布时间】:2019-01-11 22:19:23
【问题描述】:

我正在将 DATA 转换为 Decodable 结构。现在我必须在 KeyChain 中存储“可解码结构”。但是没有办法将可解码的结构存储在钥匙串中。有什么办法吗?

我被利用了 https://medium.com/ios-os-x-development/securing-user-data-with-keychain-for-ios-e720e0f9a8e2 用于钥匙串。这用于https://roadfiresoftware.com/2018/02/how-to-parse-json-with-swift-4/ Json 解析。我想在 Keychain 中存储 Decodable 对象。

【问题讨论】:

    标签: json struct swift4 decodable


    【解决方案1】:

    您可以将 JSON 或属性列表数据存储为安全说明

    在查询字典中传递一个适当的字符串标识符作为键 kSecAttrService 的值和 "secure note" 作为键 kSecAttrDescription 的值。

    【讨论】:

    • 嗨@Vadian 可以用我不明白的演示解释一下。我使用“pod 'KeychainSwift', '~> 11.0'”在钥匙链中存储数据我想在其中存储“Decodable struct”。
    • 您在问题中根本没有提到您在谈论 iOS。安全笔记在 iOS 上不可用。或许this article可以帮到你。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多