We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I have the base64-encoded public key
let publicKey = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUFxRks1TFBsclEwanpwSnhEN2VWQgpVYTBLVmVDT1o4akFaWVI0T0NWSzVlZlRGMzdHSXBlWmxrUHVVcWJsR2M4akJVMEQrMnVqU29xVUh4d1c2TmRDCklaUjBZblU4dGJNWVoyRTRlVTVzZkdySmdIbm1scEZnYlA4SDZyRWt3emZlQm03NGhkd1dXeFU4WHVtWDdUNVoKRlJHai9lRUp0a3pCMDhkS2hKckJuTTBTRzhscXU0S3k2cmd2cXh0VC9ENmNhN0g4ZVpDV0MzM29PditvSm9ITwpmd3dFRHVJVThncGFrWmNhZWpBTWVWVVdYUStES0s4THo0YmRjUGwzSUJrNFVHdTN5bVRFN2gxb3RQaDBPUUNICm5vUk1QNTdZNmMvVmVYQytmRnZXTy9mUEphUU9MYk9jV0poTFFTVGlFUTJHNzdZcnc3UDlDb1FFTWxnZDc5ZloKZlFJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0tCg=="
When I am trying:
try PublicKey(base64Encoded: publicKey) // throws error
It throws error:
asn1ParsingFailed Couldn't parse the ASN1 key data. Please file a bug at https://goo.gl/y67MW6
But the next code is working:
guard let publicKeyData = Data(base64Encoded: publicKey), let publicKeyPem = String(data: publicKeyData, encoding: .utf8) else { print("Can't decode base64") return } try PublicKey(pemEncoded: publicKeyPem) // is working
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I have the base64-encoded public key
When I am trying:
It throws error:
But the next code is working:
The text was updated successfully, but these errors were encountered: