Skip to content

Instantly share code, notes, and snippets.

@ianmcmahon
Created February 16, 2015 02:07
Show Gist options
  • Save ianmcmahon/607eb4d54a7d345f7fd5 to your computer and use it in GitHub Desktop.
Save ianmcmahon/607eb4d54a7d345f7fd5 to your computer and use it in GitHub Desktop.
let parameters: [String: AnyObject] = [
kSecAttrKeyType: kSecAttrKeyTypeRSA,
kSecAttrKeySizeInBits: 2048,
kSecAttrIsPermanent: true,
kSecAttrApplicationTag: "foobar"
]
var publicKeyPtr, privateKeyPtr: Unmanaged<SecKey>?
let result = SecKeyGeneratePair(parameters, &publicKeyPtr, &privateKeyPtr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment