Apple Keychain-backed KeyStore (MVP, ECDSA P‑256) #120
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
cryptography-provider-apple-keychain
that implements the experimentalKeyStore
API on Apple platforms using Security.framework and the Data Protection Keychain. This MVP focuses on ECDSA P‑256 key lifecycle and DER signatures. RSA and AES are stubbed for follow-ups.Dependency
What’s included
cryptography-provider-apple-keychain
AppleKeyStore
implementsKeyStore
:AsymmetricStore
withgenerate/get/exists/delete
AccessPolicy
→SecAccessControlCreateWithFlags
and accessibility classes; useskSecMatchLimitOne
andkSecUseDataProtectionKeychain
.kSecAttrIsPermanent = true
); public key export allowed.SecKeyCreateSignature
, verify withSecKeyVerifySignature
.AppleKeyStoreEcdsaTest
(generate → sign/verify → delete) on Apple targets.src/macosArm64Test
) to avoid simulator keychain variability.cryptography-provider-base
NSData helpers for safe bridging; minimal local CF bridging utilities for CFDataRef interop.cryptography-providers/apple-keychain/api/
.Design notes
kSecUseDataProtectionKeychain=true
) withkSecMatchLimitOne
for lookups.CKP_USE_DP_KEYCHAIN=1
if you want to exercise that path locally.kSecAttrApplicationTag
; optional human-readablekSecAttrLabel
is omitted in MVP for compatibility.kSecAccessControlUserPresence
; accessibility class as requested; ECDSA P‑256 is implicit for ECSECPrimeRandom in MVP.Out of scope for this PR
Testing & CI
AccessPolicy
and are not required for CI.Risk & compatibility
cryptography-storage
).Related issues
KeyStore
API.Notes for reviewers