Interface KeyManagement
- All Superinterfaces:
Provider,SdkService
- All Known Implementing Classes:
AbstractKms,AliKms,AwsKms,GcpKms
Portable control-plane operations on keys held by a cloud key management service.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.salesforce.multicloudj.common.provider.Provider
Provider.Builder -
Method Summary
Modifier and TypeMethodDescriptioncreateKey(CreateKeyRequest request) Creates a symmetric key.default DecryptResponsedecrypt(DecryptRequest request) Decrypts a ciphertext produced byencrypt(com.salesforce.multicloudj.kms.model.EncryptRequest).voiddisableKey(KeyRef keyRef) Disables a key so it can no longer be used for cryptographic operations.voidEnables a key so it can be used for cryptographic operations.default EncryptResponseencrypt(EncryptRequest request) Encrypts a small payload directly with a key.Starts an import session for a key created with external origin.getKeyPolicy(KeyRef keyRef) Reads the access policy attached to a key.Describes the subset of theKeyPolicymodel this provider enforces.Imports wrapped key material into a key created with external origin.voidsetKeyPolicy(KeyRef keyRef, KeyPolicy policy) Replaces the access policy attached to a key.booleanWhether keys created by this client can be made available across regions withCreateKeyRequest.multiRegion.voidAdds or overwrites tags on a key.Methods inherited from interface com.salesforce.multicloudj.common.service.SdkService
getProviderId, mapException
-
Method Details
-
createKey
Creates a symmetric key.- Parameters:
request- the key's configuration- Returns:
- a reference to the new key and its initial state
-
enableKey
Enables a key so it can be used for cryptographic operations. WhenKeyRef.getVersionId()is set, providers that keep state per version enable only that version; the others enable the whole key.- Parameters:
keyRef- the key to enable
-
disableKey
Disables a key so it can no longer be used for cryptographic operations. WhenKeyRef.getVersionId()is set, providers that keep state per version disable only that version; the others disable the whole key.- Parameters:
keyRef- the key to disable
-
getImportParameters
Starts an import session for a key created with external origin.- Parameters:
request- the key and the wrapping configuration- Returns:
- the public key and token to use with
importKeyMaterial(com.salesforce.multicloudj.kms.model.ImportKeyMaterialRequest)
-
importKeyMaterial
Imports wrapped key material into a key created with external origin.- Parameters:
request- the key, import token and wrapped material- Returns:
- a reference to the key, including the version created for the material where the provider versions keys
-
setKeyPolicy
Replaces the access policy attached to a key.- Parameters:
keyRef- the key whose policy is replacedpolicy- the new policy- Throws:
UnSupportedOperationException- if the policy uses anything outsidegetPolicyCapabilities()
-
getKeyPolicy
Reads the access policy attached to a key. Native policy entries that theKeyPolicymodel cannot express are omitted.- Parameters:
keyRef- the key whose policy is read- Returns:
- the key's policy
-
tagKey
Adds or overwrites tags on a key. Existing tags with other names are kept.- Parameters:
keyRef- the key to tagtags- tag names and values
-
getPolicyCapabilities
PolicyCapabilities getPolicyCapabilities()Describes the subset of theKeyPolicymodel this provider enforces.- Returns:
- the provider's policy capabilities
-
supportsMultiRegionKeys
boolean supportsMultiRegionKeys()Whether keys created by this client can be made available across regions withCreateKeyRequest.multiRegion. May depend on configuration such as the key container.- Returns:
- true if multi-region keys can be created
-
encrypt
Encrypts a small payload directly with a key.- Parameters:
request- the key, plaintext and encryption context- Returns:
- the ciphertext
- Throws:
UnSupportedOperationException- if the provider does not offer direct encryption
-
decrypt
Decrypts a ciphertext produced byencrypt(com.salesforce.multicloudj.kms.model.EncryptRequest).- Parameters:
request- the ciphertext and encryption context- Returns:
- the plaintext
- Throws:
UnSupportedOperationException- if the provider does not offer direct decryption
-