Hello,
I am currently creating a framework to able communication with JWT(JSON Web Token) on iOS, and I would like to convert the key that I get from that token, convert it into PKCS#1 since I saw that the SecKey save the rsa key in this format.
My question is, is it possible to add some additional attributes (string/data) on the SecKey variable with SecKeyCreateWithData() ? I got SecKey data in return of this function, but didnt get the extra attributes data that I attached on the label.
I tried to add some additional information for my json token, and add it into the kSecAttrLabel and kSecAttrApplicationLabel, and with the SecKeyCopyAttributes, I got nil for the kSecAttrLabel , kSecAttrApplicationLabel returned totally different data.
Many thanks in advance! 🙂
First up, read this post for information about the meaning of each of the various label attributes when dealing with keys.
Second, these labels are a property of the keychain item, not the key itself. If you want to store them, you’ll need to add the key to the keychain. If you’re trying to avoid that then you should store these attributes in your own data structure, alongside the SecKey
.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"