Secure Enclave and third-party API Keys

Hi,

I have a String that I want to:

  • encrypt it using a key.
  • generate that key with the Secure Enclave
  • store the key in the secure enclave

next time the user opens the app:

  • read the key from the secure enclave.
  • decrypt the string back.

Is it possible? I know the Secure Enclave can help me generate a key, but how to store or retrieve it? Is it possible to do that with CryptoKit?

Replies

I have a String that I want to:

How big is that string?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

The string is a third-party API key, so it is pretty small.