Key generation failed, error -25308
benpratt22 opened this issue · 1 comments
benpratt22 commented
Hi,
I am using SwiftyRSA.generateRSAKeyPair(sizeInBits: 2048)
in a class that extends UNNotificationServiceExtension
My app is occasionally throwing an error when my device is locked...
▿ SwiftyRSAError
▿ keyGenerationFailed : 1 element
▿ error : Optional<CFErrorRef>
- some : Error Domain=NSOSStatusErrorDomain Code=-25308 "Key generation failed, error -25308" UserInfo={numberOfErrorsDeep=0, NSDescription=Key generation failed, error -25308}
it seems to have the issue here:
guard let privKey = SecKeyCreateRandomKey(attributes as CFDictionary, &error),
let pubKey = SecKeyCopyPublicKey(privKey) else {
throw SwiftyRSAError.keyGenerationFailed(error: error?.takeRetainedValue())
}
Any suggestions? I am on iOS 12.0, SwiftyRSA 1.7.0
Thank you
fukemy commented