Class InternalCryptoUseCaseOperations
java.lang.Object
co.ankatech.ankasecure.keymanagement.InternalCryptoUseCaseOperations
The tenant's internal cryptographic use cases: a runtime identity (an actor and its credential), the
grants and constraints it uses, provisioned and governed as one unit. Obtained from
AuthenticatedKeyManagementSdk.internalCryptoUseCases().
CreateInternalCryptoUseCaseRequest request = new CreateInternalCryptoUseCaseRequest()
.applicationId(applicationId)
.name("invoice-signing")
.keyKid("invoice-signing-key");
try (InternalCryptoUseCaseProvisioning provisioned = sdk.internalCryptoUseCases().create(request)) {
// store provisioned.clientSecret() now: it is never returned again
}
-
Method Summary
Modifier and TypeMethodDescriptioncreate(CreateInternalCryptoUseCaseRequest request) Provisions a use case (POST /tenants/{t}/internal-crypto-use-cases) and returns its actor credential's client secret once, in a zeroizable holder.Reads one use case (GET /tenants/{t}/internal-crypto-use-cases/{id}).Lists the tenant's use cases (GET /tenants/{t}/internal-crypto-use-cases).Renews a use case's validity window (POST /tenants/{t}/internal-crypto-use-cases/{id}/renew):validUntilbecomes one year after the later of now and its current value, so renewing early never shortens what is left.Resumes a suspended use case (PATCH /tenants/{t}/internal-crypto-use-cases/{id}/resume).voidrevoke(UUID useCaseId, RevokeInternalCryptoUseCaseRequest request) Revokes a use case and the identity, grants and credential it provisioned (POST /tenants/{t}/internal-crypto-use-cases/{id}/revoke).suspend(UUID useCaseId, SuspendInternalCryptoUseCaseRequest request) Suspends a use case (PATCH /tenants/{t}/internal-crypto-use-cases/{id}/suspend).
-
Method Details
-
list
Lists the tenant's use cases (GET /tenants/{t}/internal-crypto-use-cases).- Parameters:
query- the status filter and page; must not benull- Returns:
- one page of use cases
- Throws:
KeyManagementSdkException- when the call is refused
-
create
Provisions a use case (POST /tenants/{t}/internal-crypto-use-cases) and returns its actor credential's client secret once, in a zeroizable holder.- Parameters:
request- the use case; must not benull- Returns:
- the created use case, its secret moved out of the response into the holder
- Throws:
KeyManagementSdkException- when the call is refused
-
get
Reads one use case (GET /tenants/{t}/internal-crypto-use-cases/{id}).- Parameters:
useCaseId- the use case; must not benull- Returns:
- the use case (never with its secret)
- Throws:
KeyManagementSdkException- when the call is refused
-
revoke
Revokes a use case and the identity, grants and credential it provisioned (POST /tenants/{t}/internal-crypto-use-cases/{id}/revoke). A revoked use case is never restored.- Parameters:
useCaseId- the use case; must not benullrequest- the audited reason for the revocation, required; must not benull- Throws:
KeyManagementSdkException- when the call is refused
-
renew
Renews a use case's validity window (POST /tenants/{t}/internal-crypto-use-cases/{id}/renew):validUntilbecomes one year after the later of now and its current value, so renewing early never shortens what is left. An expired use case becomes active again with the same actor and credential; a suspended one stays suspended with the longer window.- Parameters:
useCaseId- the use case; must not benull- Returns:
- the renewed use case
- Throws:
KeyManagementSdkException- when the call is refused (409 for a revoked use case)
-
suspend
public InternalCryptoUseCaseResponse suspend(UUID useCaseId, SuspendInternalCryptoUseCaseRequest request) Suspends a use case (PATCH /tenants/{t}/internal-crypto-use-cases/{id}/suspend).- Parameters:
useCaseId- the use case; must not benullrequest- the suspension reason; must not benull- Returns:
- the suspended use case
- Throws:
KeyManagementSdkException- when the call is refused
-
resume
Resumes a suspended use case (PATCH /tenants/{t}/internal-crypto-use-cases/{id}/resume).- Parameters:
useCaseId- the use case; must not benull- Returns:
- the resumed use case
- Throws:
KeyManagementSdkException- when the call is refused
-