我正在尝试将用户的 CryptoKit 公钥存储在我的 Parse 数据库中,但出现以下错误。
错误
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) 将 publicKey 转换为 String,但出现错误Initializer 'init(_:)' requires that 'Curve25519.KeyAgreement.PublicKey' conform to 'LosslessStringConvertible'