Skip to content

Instantly share code, notes, and snippets.

@cardosoedgar
Created June 29, 2020 01:12
Show Gist options
  • Save cardosoedgar/3eb1e6ae486e5a335b65084349c7cc59 to your computer and use it in GitHub Desktop.
Save cardosoedgar/3eb1e6ae486e5a335b65084349c7cc59 to your computer and use it in GitHub Desktop.
func getRawPubKey() ->String? {
var error: Unmanaged<CFError>?
guard let pubkey = getPublicKey(),
let keyData = SecKeyCopyExternalRepresentation(pubkey, &error) else { return nil }
let data = keyData as Data
return data.base64EncodedString()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment