Class RotationOperations
java.lang.Object
co.ankatech.ankasecure.keymanagement.RotationOperations
The rotation of a key: an immediate rotation, whether a rotation is admissible now, the key's
automatic-rotation schedule and the history of its scheduled executions. Obtained from
AuthenticatedKeyManagementSdk.rotation().
RotationAdmissibilityResponse verdict = sdk.rotation().admissibility("payments-signing-key");
KeySummaryResponse rotated = sdk.rotation().rotate("payments-signing-key",
new RotationRequest().newMaterial(newMaterial), "6f1c2a9e-3b4d-4e5f-8a7b-9c0d1e2f3a4b");
-
Method Summary
Modifier and TypeMethodDescriptionadmissibility(String kid) Reads whether the key may be rotated now and why not when it may not (GET /tenants/{t}/keys/{kid}/rotation-admissibility).listExecutions(String kid, RotationExecutionListQuery query) Reads the key's rotation schedule and one page of its executions, latest due first (GET /tenants/{t}/keys/{kid}/rotation-executions).replaceSchedule(String kid, KeyRotationScheduleRequest request) Replaces the key's automatic-rotation schedule (PUT /tenants/{t}/keys/{kid}/rotation-schedule).rotate(String kid, RotationRequest request) Rotates a key now (POST /tenants/{t}/keys/{kid}/rotations), without an idempotency key: every call is a new rotation.rotate(String kid, RotationRequest request, String idempotencyKey) Rotates a key now (POST /tenants/{t}/keys/{kid}/rotations) under anIdempotency-Key: a resend with the same key and request never rotates twice, and the same key with another request is refused 422idempotency-key-reused.Reads the key's automatic-rotation schedule (GET /tenants/{t}/keys/{kid}/rotation-schedule).
-
Method Details
-
rotate
Rotates a key now (POST /tenants/{t}/keys/{kid}/rotations), without an idempotency key: every call is a new rotation.- Parameters:
kid- the key identifier; must not benullrequest- the new material; must not benull- Returns:
- the rotated key
- Throws:
QuorumApprovalPendingException- when the tenant's quorum policy gates rotationKeyManagementSdkException- when the call is refused
-
rotate
Rotates a key now (POST /tenants/{t}/keys/{kid}/rotations) under anIdempotency-Key: a resend with the same key and request never rotates twice, and the same key with another request is refused 422idempotency-key-reused.- Parameters:
kid- the key identifier; must not benullrequest- the new material; must not benullidempotencyKey- 1 to 255 visible ASCII characters naming this rotation, ornullfor none- Returns:
- the rotated key
- Throws:
QuorumApprovalPendingException- when the tenant's quorum policy gates rotationKeyManagementSdkException- when the call is refused
-
admissibility
Reads whether the key may be rotated now and why not when it may not (GET /tenants/{t}/keys/{kid}/rotation-admissibility).- Parameters:
kid- the key identifier; must not benull- Returns:
- the verdict
- Throws:
KeyManagementSdkException- when the call is refused
-
schedule
Reads the key's automatic-rotation schedule (GET /tenants/{t}/keys/{kid}/rotation-schedule).- Parameters:
kid- the key identifier; must not benull- Returns:
- the schedule
- Throws:
KeyManagementSdkException- when the call is refused
-
replaceSchedule
Replaces the key's automatic-rotation schedule (PUT /tenants/{t}/keys/{kid}/rotation-schedule).- Parameters:
kid- the key identifier; must not benullrequest- the schedule; must not benull- Returns:
- the stored schedule
- Throws:
KeyManagementSdkException- when the call is refused (a staleversionis 409)
-
listExecutions
Reads the key's rotation schedule and one page of its executions, latest due first (GET /tenants/{t}/keys/{kid}/rotation-executions).- Parameters:
kid- the key identifier; must not benullquery- the page; must not benull- Returns:
- the schedule and the page of executions
- Throws:
KeyManagementSdkException- when the call is refused
-