Apple Keychain-backed KeyStore (MVP, ECDSA P‑256) #120
+923
−0
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-keychainthat implements the experimentalKeyStoreAPI 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-keychainAppleKeyStoreimplementsKeyStore:AsymmetricStorewithgenerate/get/exists/deleteAccessPolicy→SecAccessControlCreateWithFlagsand accessibility classes; useskSecMatchLimitOneandkSecUseDataProtectionKeychain.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-baseNSData helpers for safe bridging; minimal local CF bridging utilities for CFDataRef interop.cryptography-providers/apple-keychain/api/.Design notes
kSecUseDataProtectionKeychain=true) withkSecMatchLimitOnefor lookups.CKP_USE_DP_KEYCHAIN=1if you want to exercise that path locally.kSecAttrApplicationTag; optional human-readablekSecAttrLabelis 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
AccessPolicyand are not required for CI.Risk & compatibility
cryptography-storage).Related issues
KeyStoreAPI.Notes for reviewers