Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift 在数据库中存储CryptoKit公钥_Swift_Parse Platform_Parse Server_Public Key Encryption_Apple Cryptokit - Fatal编程技术网

Swift 在数据库中存储CryptoKit公钥

Swift 在数据库中存储CryptoKit公钥,swift,parse-platform,parse-server,public-key-encryption,apple-cryptokit,Swift,Parse Platform,Parse Server,Public Key Encryption,Apple Cryptokit,我试图将我用户的CryptoKit公钥存储在我的解析数据库中,但出现以下错误 错误 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'PFObject values may not have class: __SwiftValue' 代码 let privateKey = Curve25519.KeyAgreement.PrivateKey() let publicKey = pri

我试图将我用户的CryptoKit公钥存储在我的解析数据库中,但出现以下错误

错误

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'PFObject values may not have class: __SwiftValue'
代码

let privateKey = Curve25519.KeyAgreement.PrivateKey()
let publicKey = privateKey.publicKey
signUp.setObject(publicKey, forKey: "publicKey")
signUp.signUpInBackground(block: {(success, error) -> Void in
if error == nil{
    // Success handling
}else{
    // Error handling
    }
})

我尝试通过(String(publicKey)将公钥转换为字符串,但我得到错误
初始值设定项'init(:)'要求'Curve25519.KeyAgreement.publicKey'符合'LosslessStringConvertible'

你找到了让它工作的方法吗?@Voltron不幸的是没有。我最终使用了Virgil Security进行加密()我使用E3工具包是因为我需要端到端的加密。最棒的是他们已经有了专门用于解析的教程!你找到了让它工作的方法吗?@Voltron不幸的是没有。我最终使用了Virgil Security进行加密()我使用E3工具包,因为我需要端到端加密。最棒的是,他们已经有了专门用于解析的教程!