BlueRSA
BlueRSA copied to clipboard
Update to use SecKeyCreateRandomKey
iOS 15.0 deprecated SecKeyGeneratePair, so would appreciate updating to SecKeyCreateRandomKey to eliminate a warning.
Pretty easy to change over -
var privateKey: SecKey?
var publicKey: SecKey?
do {
var error: Unmanaged<CFError>?
// The keys are automatically stored in the keychain
guard let privKey = SecKeyCreateRandomKey(attributes as CFDictionary, &error) else {
throw error!.takeRetainedValue() as Error
}
privateKey = privKey
publicKey = SecKeyCopyPublicKey(privateKey!)
} catch {
ulog.error(error: error, "Error creating public/private keys")
}
@LowAmmo Thanks! Please submit a PR
@dannys42 - Sure, I'll work on putting one together!
@dannys42 - Created pull request (above)
As a note...wasn't sure about versioning. Went ahead and upped the version of the podspec in the PR...but not sure if that was the right way to do it...