Package org.springframework.vault.core
Class VaultTransformTemplate
java.lang.Object
org.springframework.vault.core.VaultTransformTemplate
- All Implemented Interfaces:
VaultTransformOperations
Default implementation of
VaultTransformOperations.- Since:
- 2.3
- Author:
- Lauren Voswinkel, Mark Paluch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecode(String roleName, String ciphertext, VaultTransformContext transformContext) Decode the provided ciphertext using the named role.decode(String roleName, List<TransformCiphertext> batchRequest) Decode the provided batch of ciphertext using the role given and transformation in each list item.decode(String roleName, TransformCiphertext ciphertext) Decode the provided ciphertext using the named role.Encode the provided plaintext using the named role.encode(String roleName, List<TransformPlaintext> batchRequest) Encode the provided batch of plaintext using the role given and transformation in each list item.encode(String roleName, TransformPlaintext plaintext) Encode the provided plaintext using the named role.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.vault.core.VaultTransformOperations
decode, encode
-
Constructor Details
-
VaultTransformTemplate
- Parameters:
vaultOperations- must not be null.path- must not be empty or null.
-
-
Method Details
-
encode
Description copied from interface:VaultTransformOperationsEncode the provided plaintext using the named role.- Specified by:
encodein interfaceVaultTransformOperations- Parameters:
roleName- must not be empty or null.plaintext- must not be empty or null.- Returns:
- cipher text.
-
encode
Description copied from interface:VaultTransformOperationsEncode the provided plaintext using the named role.- Specified by:
encodein interfaceVaultTransformOperations- Parameters:
roleName- must not be empty or null.plaintext- must not be null.- Returns:
- cipher text.
-
encode
public List<VaultTransformEncodeResult> encode(String roleName, List<TransformPlaintext> batchRequest) Description copied from interface:VaultTransformOperationsEncode the provided batch of plaintext using the role given and transformation in each list item. The encryption is done using transformation secret backend's batch operation.- Specified by:
encodein interfaceVaultTransformOperations- Parameters:
roleName- must not be empty or null.batchRequest- a list ofPlaintextwhich includes plaintext and an optional context.- Returns:
- the encrypted result in the order of
batchRequestplaintexts.
-
decode
Description copied from interface:VaultTransformOperationsDecode the provided ciphertext using the named role.- Specified by:
decodein interfaceVaultTransformOperations- Parameters:
roleName- must not be empty or null.ciphertext- must not be null.- Returns:
- plain text.
-
decode
Description copied from interface:VaultTransformOperationsDecode the provided ciphertext using the named role.- Specified by:
decodein interfaceVaultTransformOperations- Parameters:
roleName- must not be empty or null.ciphertext- must not be empty or null.transformContext- must not be null. UseVaultTransformContext.empty()if no request options provided.- Returns:
- plain text.
-
decode
public List<VaultTransformDecodeResult> decode(String roleName, List<TransformCiphertext> batchRequest) Description copied from interface:VaultTransformOperationsDecode the provided batch of ciphertext using the role given and transformation in each list item. The decryption is done using transformation secret backend's batch operation.- Specified by:
decodein interfaceVaultTransformOperations- Parameters:
roleName- must not be empty or null.batchRequest- a list ofCiphertextwhich includes plaintext and an optional context.- Returns:
- the decrypted result in the order of
batchRequestciphertexts.
-