https://github.com/kizzycode/secureenclave-c
This packet provides a thin C API to interact with an Apple device's secure enclave co-processor
https://github.com/kizzycode/secureenclave-c
Last synced: about 2 months ago
JSON representation
This packet provides a thin C API to interact with an Apple device's secure enclave co-processor
- Host: GitHub
- URL: https://github.com/kizzycode/secureenclave-c
- Owner: KizzyCode
- Created: 2023-03-29T19:45:53.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-04-02T16:57:22.000Z (about 2 years ago)
- Last Synced: 2025-02-06T04:44:19.377Z (3 months ago)
- Language: Swift
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://opensource.org/licenses/BSD-2-Clause)
[](https://opensource.org/licenses/MIT)# SecureEnclave
This packet provides a thin C API to interact with an Apple device's secure enclave co-processor.
With this API you can
- generate a secure enclave backed ECDSA or ECDH P256 private key with different access-requirements (unlocked once,
currently unlocked, user-interactive, user-interactive with biometry, user-interactive with same biometry, ...)
- compute the public key from the sealed private key blob (obviously)
- sign a hash value using P256-ECDSA
- derive a shared secret using P256-ECDH## Building the library
This library requires the `XCode Command Line Tools` build-toolchain. To build the package, go into the project root and
execute `swift build --configuration=release`. The library artifact is at `.build/release/libSecureEnclave.a`. The
associated API header is located in `Sources/SecureEnclave/include/SecureEnclave.h`.Have fun\~
## Example
You can find an example in `Sources/SecureEnclave-Example/main.c`. To run the example, go into the project root and
execute `swift run --configuration=release`. Please note that this example requires user-interactive biometric
authentication and thus does not work on devices without enrolled TouchID or FaceID.