Add abstraction for managing pools of certified keys. - #1978
Merged
Conversation
Add an abstraction for managing pools of keys generated locally in a secure area and certified by a certifying authority: - In `CertifiedKeyManager`, implement a key pool manager backed by any `SecureArea` and `Storage` implementation. Support batch certification of locally generated keys, configurable proactive replenishment threshold (`replenishThresholdFraction`, defaulting to 50%), configurable key retirement threshold (`refreshThresholdFraction`, defaulting to two thirds of certificate validity), resilient offline operation by retaining the last valid key during network outages, and self-healing cleanup of stale keys removed from the underlying secure area. - Expose `CertifiedKeyManager.createWithSingleKeyCertifier()` to support single-key certification callbacks without JVM method signature clashes. - In `CertifiedKeyManagerTest`, add comprehensive multiplatform unit tests covering happy path retrieval, batch replenishment, key expiration, offline degradation, stale key cleanup, single-key certifier factory creation, pool clearing, and custom threshold configurations. Fixes #1977. Test: Ran ./gradlew :multipaz:jvmTest Test: Ran ./gradlew :multipaz:assemble Test: Ran ./gradlew detekt Signed-off-by: David Zeuthen <zeuthen@gmail.com>
davidz25
force-pushed
the
reader-key-manager
branch
from
September 4, 2026 07:35
ba7a90e to
9e0b994
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add an abstraction for managing pools of keys generated locally in a secure area and certified by a certifying authority:
CertifiedKeyManager, implement a key pool manager backed by anySecureAreaandStorageimplementation. Support batch certification of locally generated keys, proactive replenishment when the pool of fresh keys falls below 50%, proactive key retirement after two thirds of certificate validity, resilient offline operation by retaining the last valid key during network outages, and self-healing cleanup of stale keys removed from the underlying secure area.CertifiedKeyManager.createWithSingleKeyCertifier()to support single-key certification callbacks without JVM method signature clashes.CertifiedKeyManagerTest, add comprehensive multiplatform unit tests covering happy path retrieval, batch replenishment, key expiration, offline degradation, stale key cleanup, single-key certifier factory creation, and pool clearing.Fixes #1977.
Test: Ran ./gradlew :multipaz:jvmTest
Test: Ran ./gradlew :multipaz:assemble
Test: Ran ./gradlew detekt