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-storagethat 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@ExperimentalKeyStorageApiopt-in annotationAccessPolicy,Accessibility,DeviceBindingKeyAttributes(extractable, persistent, label)Handle<Public, Private>AsymmetricStore<Public, Private>andSymmetricStore<Key>KeyStoreentry with typed stores:ecdsa(curve: EC.Curve = EC.Curve.P256)rsaPss(...),rsaPkcs1(...),rsaOaep(...)aesGcm(...),aesCbc(...),aesCtr(...)DelicateCryptographyApi.StorageApiSmokeTestexercising CRUD semantics using test-only in-memory stores.settings.gradle.ktsandbuild-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)
KeyStoremappingAccessPolicy→ 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.