Class AzureKeyVaultDataEncryptor
- java.lang.Object
-
- com.avoka.fc.core.service.storage.AzureKeyVaultDataEncryptor
-
- All Implemented Interfaces:
ISubmissionDataEncryptor
public class AzureKeyVaultDataEncryptor extends Object
Azure KeyVault Submission Data Encryptor Implementation Class.- Since:
- 20.5.0
-
-
Field Summary
Fields Modifier and Type Field Description protected String
currentMasterKey
protected static String
SERVICE_PARAM_AZURE_KEY_VAULT_CLIENT_ID
protected static String
SERVICE_PARAM_AZURE_KEY_VAULT_CLIENT_SECRET
protected static String
SERVICE_PARAM_AZURE_KEY_VAULT_KEY_MAPPING
protected static String
SERVICE_PARAM_AZURE_KEY_VAULT_TENANT_ID
protected ServiceDefinition
serviceDef
-
Constructor Summary
Constructors Constructor Description AzureKeyVaultDataEncryptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
decodeData(Submission submission, byte[] data, String encoding)
Decode the data for the given submission with the encoding type.String
decryptText(Submission submission, String cypherText)
Decrypt a submission related string that was created using encryptTextbyte[]
encodeData(Submission submission, byte[] data, String encoding)
Encode the data for the given submission with the encoding type.String
encryptText(Submission submission, String plainText)
Encrypt a string related to a submission.boolean
initializeCryptoDataKey(Submission submission)
Initializes the crypto data key for the submission This is called on Render to avoid a race condition TMR-2171 with multi simultaneous Dynamic Data Calls.void
setStorageServiceDefinition(ServiceDefinition serviceDef)
Set the parent submission data storage service definition.
-
-
-
Field Detail
-
SERVICE_PARAM_AZURE_KEY_VAULT_CLIENT_ID
protected static final String SERVICE_PARAM_AZURE_KEY_VAULT_CLIENT_ID
- See Also:
- Constant Field Values
-
SERVICE_PARAM_AZURE_KEY_VAULT_CLIENT_SECRET
protected static final String SERVICE_PARAM_AZURE_KEY_VAULT_CLIENT_SECRET
- See Also:
- Constant Field Values
-
SERVICE_PARAM_AZURE_KEY_VAULT_TENANT_ID
protected static final String SERVICE_PARAM_AZURE_KEY_VAULT_TENANT_ID
- See Also:
- Constant Field Values
-
SERVICE_PARAM_AZURE_KEY_VAULT_KEY_MAPPING
protected static final String SERVICE_PARAM_AZURE_KEY_VAULT_KEY_MAPPING
- See Also:
- Constant Field Values
-
currentMasterKey
protected String currentMasterKey
-
serviceDef
protected ServiceDefinition serviceDef
-
-
Method Detail
-
setStorageServiceDefinition
public void setStorageServiceDefinition(ServiceDefinition serviceDef)
Set the parent submission data storage service definition.- Specified by:
setStorageServiceDefinition
in interfaceISubmissionDataEncryptor
- Parameters:
serviceDef
- set the parent submission data storage service definition.- See Also:
ISubmissionDataEncryptor.setStorageServiceDefinition(ServiceDefinition)
-
encodeData
public byte[] encodeData(Submission submission, byte[] data, String encoding)
Encode the data for the given submission with the encoding type.- Specified by:
encodeData
in interfaceISubmissionDataEncryptor
- Parameters:
submission
- the submission record (required)data
- the data to encode (required)encoding
- the encoding mode- Returns:
- the encode data
- See Also:
ISubmissionDataEncryptor.encodeData(Submission, byte[], String)
-
decodeData
public byte[] decodeData(Submission submission, byte[] data, String encoding)
Decode the data for the given submission with the encoding type.- Specified by:
decodeData
in interfaceISubmissionDataEncryptor
- Parameters:
submission
- the submission record (required)data
- the data to encode (required)encoding
- the encoding mode- Returns:
- the encode data
- See Also:
ISubmissionDataEncryptor.decodeData(Submission, byte[], String)
-
encryptText
public String encryptText(Submission submission, String plainText)
Encrypt a string related to a submission.- Specified by:
encryptText
in interfaceISubmissionDataEncryptor
- Parameters:
submission
- the submission which the string relates to (required)plainText
- the plain text string to be encrypted- Returns:
- the encrypted string - note that this will generally be longer than the original
- See Also:
ISubmissionDataEncryptor.encryptText(Submission, String)
-
decryptText
public String decryptText(Submission submission, String cypherText)
Decrypt a submission related string that was created using encryptText- Specified by:
decryptText
in interfaceISubmissionDataEncryptor
- Parameters:
submission
- the submission which the string relates to (required)cypherText
- the encrypted string- Returns:
- the plain text string
- See Also:
ISubmissionDataEncryptor.decryptText(Submission, String)
-
initializeCryptoDataKey
public boolean initializeCryptoDataKey(Submission submission)
Initializes the crypto data key for the submission This is called on Render to avoid a race condition TMR-2171 with multi simultaneous Dynamic Data Calls.- Specified by:
initializeCryptoDataKey
in interfaceISubmissionDataEncryptor
- Parameters:
submission
- the submission to which the data key will be created- Returns:
- true as the submission data storage has stored a crypto key
-
-