Class MaterialOperations

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

public final class MaterialOperations extends Object
The material versions of a key: every version the key has had, with its status, and the revocation of one version. Obtained from AuthenticatedKeyManagementSdk.materials(). Destroying a version is a request (AuthenticatedKeyManagementSdk.destruction()), never a direct operation.

 List<MaterialVersionResponse> versions = sdk.materials().list("payments-signing-key");
 
  • Method Details

    • list

      public List<MaterialVersionResponse> list(String stableKid)
      Lists a key's material versions (GET /tenants/{t}/keys/{stableKid}/materials).
      Parameters:
      stableKid - the key's stable identifier; must not be null
      Returns:
      every version, newest first
      Throws:
      KeyManagementSdkException - when the call is refused
    • get

      public MaterialVersionResponse get(String stableKid, int version)
      Reads one material version (GET /tenants/{t}/keys/{stableKid}/materials/{version}).
      Parameters:
      stableKid - the key's stable identifier; must not be null
      version - the version number
      Returns:
      the version
      Throws:
      KeyManagementSdkException - when the version does not exist (404) or the call is refused
    • revoke

      public MaterialVersionResponse revoke(String stableKid, int version, MaterialRevokeRequest request)
      Revokes one material version (POST /tenants/{t}/keys/{stableKid}/materials/{version}/revoke).
      Parameters:
      stableKid - the key's stable identifier; must not be null
      version - the version number
      request - the revocation cause and reason; must not be null
      Returns:
      the revoked version
      Throws:
      KeyManagementSdkException - when the call is refused