Ah, you’re using Security framework not Apple CryptoKit. That explains my confusion. I’ve changed the tags on your thread to reflect that.
As to your main problem, you wrote:
I am trying to decrypt in the same way.
I’d like to clarify this setup. Based on this and your earlier post I think you’re doing this:
-
On {mac,i,tv,watch}OS device A, you call SecKeyCreateEncryptedData
to encrypt some data.
-
You then passing that data to {mac,i,tv,watch}OS device B.
-
On device B you call SecKeyCreateDecryptedData
to decrypt that data.
Is that correct?
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"