Swift 在数据库中存储CryptoKit公钥
我试图将我用户的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
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工具包,因为我需要端到端加密。最棒的是,他们已经有了专门用于解析的教程!