Apple CryptoKit on VisionOS

Hello, is Apple CryptoKit support planned for the first release of VisionOS?

Thank you

Answered by DTS Engineer in 764555022

OK, there’s a lot to unpack here. To start, this:

And when I was checking the docs and I didn't see visionOS 1.0+ listed.

Yeah, I noticed that too, but I wrote it off as a doc issue. In general, the headers [1] are the source of truth. Feel free to file a bug against the docs.

SecureEnclave.isAvailable reports false for the visionOS simulator

Indeed. First things first, the availability of the SE is not the same as the availability of Apple CryptoKit. You can do lots of useful stuff with CryptoKit on a machine without an SE.

Second, it’s not uncommon for the simulator to not simulate certain aspects of the real hardware. I suspect that the SE will be available on a real device [2].

but true for the iPad iOS 17 simulator

Yep. I recommend that you file a bug agains the simulator. Please post your bug number, just for the record.

Share and Enjoy

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

[1] Well, a Swift-only framework like CryptoKit has no headers, but you know what I mean.

[2] But I don’t have one handy right now to check that. Even if I did, this is all pre-release stuff, so things might change.

It’s already in the visionOS SDK. What makes you think it’s not there?

Share and Enjoy

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

Hey, thanks for the speedy response.

I tried to run our app on the visionOS 1 beta 3 Simulator Runtime and got a thrown exception noSEP when trying to use ;

let access = SecAccessControlCreateWithFlags(kCFAllocatorDefault,
                                             kSecAttrAccessibleWhenUnlockedThisDeviceOnly,
                                             .privateKeyUsage,
                                             &error)!
CryptoKit.SecureEnclave.P256.KeyAgreement.PrivateKey(accessControl:access)

SecureEnclave.isAvailable reports false for the visionOS simulator but true for the iPad iOS 17 simulator (on an M1 MacBook Pro).

And when I was checking the docs and I didn't see visionOS 1.0+ listed.

Cheers

Accepted Answer

OK, there’s a lot to unpack here. To start, this:

And when I was checking the docs and I didn't see visionOS 1.0+ listed.

Yeah, I noticed that too, but I wrote it off as a doc issue. In general, the headers [1] are the source of truth. Feel free to file a bug against the docs.

SecureEnclave.isAvailable reports false for the visionOS simulator

Indeed. First things first, the availability of the SE is not the same as the availability of Apple CryptoKit. You can do lots of useful stuff with CryptoKit on a machine without an SE.

Second, it’s not uncommon for the simulator to not simulate certain aspects of the real hardware. I suspect that the SE will be available on a real device [2].

but true for the iPad iOS 17 simulator

Yep. I recommend that you file a bug agains the simulator. Please post your bug number, just for the record.

Share and Enjoy

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

[1] Well, a Swift-only framework like CryptoKit has no headers, but you know what I mean.

[2] But I don’t have one handy right now to check that. Even if I did, this is all pre-release stuff, so things might change.

Thank you for the information. I've gone ahead and raised those bugs.

Apple CryptoKit Documentation not marked as supporting visionOS: FB13168808 visionOS Simulator Secure Enclave Unavailable: FB13168845

Any news?

Apple CryptoKit on VisionOS
 
 
Q