Add experimental storage API module (KeyStore, AccessPolicy, KeyAttributes) #119
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-storage
that defines a provider-agnostic, experimental key storage API. The API enables generation, retrieval, existence checks, and deletion of persistent, non-extractable keys under binary-safe labels, with access controls abstracted viaAccessPolicy
.What’s included
cryptography-storage
@ExperimentalKeyStorageApi
opt-in annotationAccessPolicy
,Accessibility
,DeviceBinding
KeyAttributes
(extractable, persistent, label)Handle<Public, Private>
AsymmetricStore<Public, Private>
andSymmetricStore<Key>
KeyStore
entry with typed stores:ecdsa(curve: EC.Curve = EC.Curve.P256)
rsaPss(...)
,rsaPkcs1(...)
,rsaOaep(...)
aesGcm(...)
,aesCbc(...)
,aesCtr(...)
DelicateCryptographyApi
.StorageApiSmokeTest
exercising CRUD semantics using test-only in-memory stores.settings.gradle.kts
andbuild-logic/ckbuild/Projects.kt
.cryptography-storage/api/
.Design notes
@ExperimentalKeyStorageApi
(opt-in) to allow iteration.ByteArray
) to accommodate provider-specific aliasing needs.Out of scope (follow-ups)
KeyStore
mappingAccessPolicy
→ Security.framework (RSA/AES/ECDSA P‑256) with macOS tests.Testing & CI
Docs
Risk & compatibility
Checklist
Notes for reviewers
Related issues
AsymmetricPublicKey
,AsymmetricPrivateKey.publicKey()
,SecretKey
) are intentionally out of scope here and proposed as a separate experimental PR to avoid coupling and keep this change additive.