Class KeyManagementServiceImpl

java.lang.Object
co.ankatech.ankasecure.sdk.internal.service.impl.KeyManagementServiceImpl
All Implemented Interfaces:
co.ankatech.ankasecure.sdk.internal.service.KeyManagementService

public final class KeyManagementServiceImpl extends Object implements co.ankatech.ankasecure.sdk.internal.service.KeyManagementService
Thread-safe implementation of KeyManagementService.
  • Constructor Details

    • KeyManagementServiceImpl

      public KeyManagementServiceImpl(co.ankatech.ankasecure.openapi.client.AnkaSecureOpenApiClient api)
  • Method Details

    • listKeys

      public KeyPage listKeys(KeyFilters filters, int page, int size) throws AnkaSecureSdkException
      Description copied from interface: co.ankatech.ankasecure.sdk.internal.service.KeyManagementService
      Lists ONE PAGE of keys with optional server-side filters (applied BEFORE pagination — the page totals are filtered, tenant-scoped counts).
      Specified by:
      listKeys in interface co.ankatech.ankasecure.sdk.internal.service.KeyManagementService
      Parameters:
      filters - server-side filters; use KeyFilters.none() for all keys
      page - zero-based page index
      size - page size (1..200; values above 200 are rejected by the server with 400)
      Returns:
      the page of key metadata with totals; never null
      Throws:
      AnkaSecureSdkException - if the server returns an error
    • listAllKeys

      public List<KeyMetadata> listAllKeys(KeyFilters filters) throws AnkaSecureSdkException
      Description copied from interface: co.ankatech.ankasecure.sdk.internal.service.KeyManagementService
      Lists ALL keys matching the filters by auto-paginating through the server's paginated listing (AWS-paginator pattern, page size 200). The iteration is bounded by ceil(totalElements/size)+1 pages with a defensive hard cap; exceeding the cap THROWS PaginationCeilingExceededException (never silent truncation). Offset-pagination drift (keys created/deleted between page fetches) is accepted best-effort, as in every major KMS CLI.
      Specified by:
      listAllKeys in interface co.ankatech.ankasecure.sdk.internal.service.KeyManagementService
      Parameters:
      filters - server-side filters; use KeyFilters.none() for all keys
      Returns:
      all matching key metadata; never null, may be empty
      Throws:
      AnkaSecureSdkException - if the server returns an error
    • getKeyMetadata

      public KeyMetadata getKeyMetadata(String kid) throws AnkaSecureSdkException
      Description copied from interface: co.ankatech.ankasecure.sdk.internal.service.KeyManagementService
      Retrieves metadata for a specific key.

      Returns type-safe KeyMetadata without exposing generated classes. Works with both simple and composite (hybrid) keys.

      Specified by:
      getKeyMetadata in interface co.ankatech.ankasecure.sdk.internal.service.KeyManagementService
      Parameters:
      kid - key identifier
      Returns:
      key metadata containing complete information
      Throws:
      AnkaSecureSdkException - if key not found
    • getSupportedAlgorithms

      public List<AlgorithmInfo> getSupportedAlgorithms() throws AnkaSecureSdkException
      Description copied from interface: co.ankatech.ankasecure.sdk.internal.service.KeyManagementService
      Retrieves all supported algorithms without filtering.
      Specified by:
      getSupportedAlgorithms in interface co.ankatech.ankasecure.sdk.internal.service.KeyManagementService
      Returns:
      list of all algorithm profiles
      Throws:
      AnkaSecureSdkException - if the API call fails
    • getSupportedAlgorithms

      public List<AlgorithmInfo> getSupportedAlgorithms(AlgorithmFilter filter) throws AnkaSecureSdkException
      Description copied from interface: co.ankatech.ankasecure.sdk.internal.service.KeyManagementService
      Retrieves supported algorithms matching the specified filter criteria. Filtering is performed server-side for optimal performance.
      Specified by:
      getSupportedAlgorithms in interface co.ankatech.ankasecure.sdk.internal.service.KeyManagementService
      Parameters:
      filter - the filter criteria (null returns all algorithms)
      Returns:
      filtered list of algorithm profiles
      Throws:
      AnkaSecureSdkException - if the API call fails
      See Also: