Interface KmsDriver
public interface KmsDriver
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault booleandoesSupport(String keyUri) default com.google.crypto.tink.KmsClientgetKmsClient(String kekUrl) default ObjectgetTestClient(Map<String, ?> configs) default booleanReturns true if the given throwable, or any of its causes, indicates that the KMS rejected the request because the caller is not authenticated or not authorized (i.e.default booleanReturns true if this single throwable (not its causes) is a provider-specific exception that represents an authentication or authorization failure.default booleanisAccessDeniedStatus(int statusCode) Returns true if the given HTTP status code denotes an authentication/authorization failure (401 or 403).com.google.crypto.tink.KmsClientnewKmsClient(Map<String, ?> configs, Optional<String> kekUrl) default com.google.crypto.tink.KmsClientregisterKmsClient(Map<String, ?> configs, Optional<String> kekUrl)
-
Field Details
-
KMS_TYPE_SUFFIX
- See Also:
-
TEST_CLIENT
- See Also:
-
-
Method Details
-
getKeyUrlPrefix
String getKeyUrlPrefix() -
newKmsClient
com.google.crypto.tink.KmsClient newKmsClient(Map<String, ?> configs, Optional<String> kekUrl) throws GeneralSecurityException- Throws:
GeneralSecurityException
-
doesSupport
- Returns:
- true if this client does support
keyUri
-
isAccessDenied
Returns true if the given throwable, or any of its causes, indicates that the KMS rejected the request because the caller is not authenticated or not authorized (i.e. a 401 or 403), so that such failures can be surfaced as a 4xx rather than a 5xx. Walks the cause chain and delegates toisAccessDeniedException(Throwable), which drivers override to inspect their own provider-specific exception types. -
isAccessDeniedException
Returns true if this single throwable (not its causes) is a provider-specific exception that represents an authentication or authorization failure. Defaults to false. -
isAccessDeniedStatus
default boolean isAccessDeniedStatus(int statusCode) Returns true if the given HTTP status code denotes an authentication/authorization failure (401 or 403). Single source of truth for the access-denied status set shared by drivers. -
getKmsClient
default com.google.crypto.tink.KmsClient getKmsClient(String kekUrl) throws GeneralSecurityException - Throws:
GeneralSecurityException
-
registerKmsClient
default com.google.crypto.tink.KmsClient registerKmsClient(Map<String, ?> configs, Optional<String> kekUrl) throws GeneralSecurityException- Throws:
GeneralSecurityException
-
getTestClient
-