The data works with OpenSSL in the following manner:
p = buf;
X509_PUBKEY *x = d2i_X509_PUBKEY(NULL, &p, len);
EVP_PKEY *x509 = X509_PUBKEY_get(x);
gets a usable EVP_PKEY.
p = buf;
509 *x509Ptr = d2i_X509(NULL, &p, len);
x509Ptr is NULL.
How do I use the public key in the buffer with the Security framework in a SecKeyRef?
SecTrustEvaluate always returns to me a fatal error and adding exceptions doesn't work.
Did you mean to link to https://devforums.apple.com/message/944466#944466?
No. Sorry. I meant
<https://devforums.apple.com/message/950088#950088>
, but the URL didn’t stick due to a Markdown failure at my end.
Trying to use it to do an encryption is failing regularly, so I'm still missing something.
There’s two things that could be causing this:
you’re importing the key incorrectly
your encryption code is wrong
To see which is which, try comparing your encryption code to the code in CryptoCompatibility. In fact, you should be able to take the encrypt operation from that code (QCCRSASmallCryptorT), which I know works, and wire it up to the key you imported.
Share and Enjoy
—
Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"