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 Summary
ConstructorsConstructorDescriptionKeyManagementServiceImpl(co.ankatech.ankasecure.openapi.client.AnkaSecureOpenApiClient api) -
Method Summary
Modifier and TypeMethodDescriptiongetKeyMetadata(String kid) Retrieves metadata for a specific key.Retrieves all supported algorithms without filtering.Retrieves supported algorithms matching the specified filter criteria.listAllKeys(KeyFilters filters) Lists ALL keys matching the filters by auto-paginating through the server's paginated listing (AWS-paginator pattern, page size 200).listKeys(KeyFilters filters, int page, int size) Lists ONE PAGE of keys with optional server-side filters (applied BEFORE pagination — the page totals are filtered, tenant-scoped counts).
-
Constructor Details
-
KeyManagementServiceImpl
public KeyManagementServiceImpl(co.ankatech.ankasecure.openapi.client.AnkaSecureOpenApiClient api)
-
-
Method Details
-
listKeys
Description copied from interface:co.ankatech.ankasecure.sdk.internal.service.KeyManagementServiceLists ONE PAGE of keys with optional server-side filters (applied BEFORE pagination — the page totals are filtered, tenant-scoped counts).- Specified by:
listKeysin interfaceco.ankatech.ankasecure.sdk.internal.service.KeyManagementService- Parameters:
filters- server-side filters; useKeyFilters.none()for all keyspage- zero-based page indexsize- 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
Description copied from interface:co.ankatech.ankasecure.sdk.internal.service.KeyManagementServiceLists ALL keys matching the filters by auto-paginating through the server's paginated listing (AWS-paginator pattern, page size 200). The iteration is bounded byceil(totalElements/size)+1pages with a defensive hard cap; exceeding the cap THROWSPaginationCeilingExceededException(never silent truncation). Offset-pagination drift (keys created/deleted between page fetches) is accepted best-effort, as in every major KMS CLI.- Specified by:
listAllKeysin interfaceco.ankatech.ankasecure.sdk.internal.service.KeyManagementService- Parameters:
filters- server-side filters; useKeyFilters.none()for all keys- Returns:
- all matching key metadata; never
null, may be empty - Throws:
AnkaSecureSdkException- if the server returns an error
-
getKeyMetadata
Description copied from interface:co.ankatech.ankasecure.sdk.internal.service.KeyManagementServiceRetrieves metadata for a specific key.Returns type-safe KeyMetadata without exposing generated classes. Works with both simple and composite (hybrid) keys.
- Specified by:
getKeyMetadatain interfaceco.ankatech.ankasecure.sdk.internal.service.KeyManagementService- Parameters:
kid- key identifier- Returns:
- key metadata containing complete information
- Throws:
AnkaSecureSdkException- if key not found
-
getSupportedAlgorithms
Description copied from interface:co.ankatech.ankasecure.sdk.internal.service.KeyManagementServiceRetrieves all supported algorithms without filtering.- Specified by:
getSupportedAlgorithmsin interfaceco.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.KeyManagementServiceRetrieves supported algorithms matching the specified filter criteria. Filtering is performed server-side for optimal performance.- Specified by:
getSupportedAlgorithmsin interfaceco.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:
-