Class InternalCryptoUseCaseOperations

java.lang.Object
co.ankatech.ankasecure.keymanagement.InternalCryptoUseCaseOperations

public final class InternalCryptoUseCaseOperations extends Object
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 Details

    • list

      Lists the tenant's use cases (GET /tenants/{t}/internal-crypto-use-cases).
      Parameters:
      query - the status filter and page; must not be null
      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 be null
      Returns:
      the created use case, its secret moved out of the response into the holder
      Throws:
      KeyManagementSdkException - when the call is refused
    • get

      public InternalCryptoUseCaseResponse get(UUID useCaseId)
      Reads one use case (GET /tenants/{t}/internal-crypto-use-cases/{id}).
      Parameters:
      useCaseId - the use case; must not be null
      Returns:
      the use case (never with its secret)
      Throws:
      KeyManagementSdkException - when the call is refused
    • delete

      public void delete(UUID useCaseId, String reason)
      Revokes a use case and the identity, grants and credential it provisioned (DELETE /tenants/{t}/internal-crypto-use-cases/{id}).
      Parameters:
      useCaseId - the use case; must not be null
      reason - why it is revoked, recorded in the audit trail, or null
      Throws:
      KeyManagementSdkException - when the call is refused
    • suspend

      Suspends a use case (PATCH /tenants/{t}/internal-crypto-use-cases/{id}/suspend).
      Parameters:
      useCaseId - the use case; must not be null
      request - the suspension reason; must not be null
      Returns:
      the suspended use case
      Throws:
      KeyManagementSdkException - when the call is refused
    • resume

      public InternalCryptoUseCaseResponse resume(UUID useCaseId)
      Resumes a suspended use case (PATCH /tenants/{t}/internal-crypto-use-cases/{id}/resume).
      Parameters:
      useCaseId - the use case; must not be null
      Returns:
      the resumed use case
      Throws:
      KeyManagementSdkException - when the call is refused