Class MetadataEncryptor
java.lang.Object
org.alfresco.repo.node.encryption.MetadataEncryptor
Component to convert encrypt/decrypt properties.
This is a helper; it is up to the client how and when encryption and decryption is done,
but metadata integrity enforcement will expect that encrypted properties are already
encrypted.
This class must always be used
running as 'system'.- Since:
- 4.0
- Author:
- Derek Hulley
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbackupKeyAvailable(String keyAlias) decrypt(Map<QName, Serializable> inbound) Decrypt properties if they are decryptable.decrypt(QName propertyQName, Serializable inbound) Decrypt a property if the data definition (model-specific) requires it.encrypt(Map<QName, Serializable> inbound) Encrypt properties if their data definition (model-specific) requires it.encrypt(QName propertyQName, Serializable inbound) Encrypt a properties if the data definition (model-specific) requires it.booleankeyAvailable(String keyAlias) voidsetDictionaryService(DictionaryService dictionaryService) voidsetEncryptor(org.alfresco.encryption.FallbackEncryptor encryptor)
-
Constructor Details
-
MetadataEncryptor
public MetadataEncryptor()
-
-
Method Details
-
setDictionaryService
- Parameters:
dictionaryService- service to check if properties need encrypting
-
setEncryptor
public void setEncryptor(org.alfresco.encryption.FallbackEncryptor encryptor) - Parameters:
encryptor- the class that does the encryption/decryption
-
encrypt
Encrypt a properties if the data definition (model-specific) requires it.- Parameters:
propertyQName- the property qualified nameinbound- the property to encrypt- Returns:
- the encrypted property or the original if encryption is not required
-
decrypt
Decrypt a property if the data definition (model-specific) requires it.- Parameters:
propertyQName- the property qualified nameinbound- the property to decrypt- Returns:
- the decrypted property or the original if it wasn't encrypted
-
encrypt
Encrypt properties if their data definition (model-specific) requires it. The values provided can be mixed; values will be encrypted only if required.- Parameters:
inbound- the properties to encrypt- Returns:
- a new map of values if some encryption occured otherwise the original inbound map is returned
-
decrypt
Decrypt properties if they are decryptable. The values provided can be mixed; encrypted values will be sought out and decrypted.- Parameters:
inbound- the properties to decrypt- Returns:
- a new map of values if some decryption occured otherwise the original inbound map is returned
-
keyAvailable
-
backupKeyAvailable
-