Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to use SecKeyCreateRandomKey #77

Open
LowAmmo opened this issue Sep 28, 2022 · 3 comments
Open

Update to use SecKeyCreateRandomKey #77

LowAmmo opened this issue Sep 28, 2022 · 3 comments

Comments

@LowAmmo
Copy link
Contributor

LowAmmo commented Sep 28, 2022

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")
    }
@dannys42
Copy link
Contributor

@LowAmmo Thanks! Please submit a PR

@LowAmmo
Copy link
Contributor Author

LowAmmo commented Sep 30, 2022

@dannys42 - Sure, I'll work on putting one together!

@LowAmmo
Copy link
Contributor Author

LowAmmo commented Sep 30, 2022

@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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants