Class MetadataEncryptor
- java.lang.Object
-
- org.alfresco.repo.node.encryption.MetadataEncryptor
-
public class MetadataEncryptor extends java.lang.ObjectComponent 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 usedrunning as 'system'.- Since:
- 4.0
- Author:
- Derek Hulley
-
-
Constructor Summary
Constructors Constructor Description MetadataEncryptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanbackupKeyAvailable(java.lang.String keyAlias)java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable>decrypt(java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> inbound)Decrypt properties if they are decryptable.java.io.Serializabledecrypt(org.alfresco.service.namespace.QName propertyQName, java.io.Serializable inbound)Decrypt a property if the data definition (model-specific) requires it.java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable>encrypt(java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> inbound)Encrypt properties if their data definition (model-specific) requires it.java.io.Serializableencrypt(org.alfresco.service.namespace.QName propertyQName, java.io.Serializable inbound)Encrypt a properties if the data definition (model-specific) requires it.booleankeyAvailable(java.lang.String keyAlias)voidsetDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)voidsetEncryptor(org.alfresco.encryption.FallbackEncryptor encryptor)
-
-
-
Method Detail
-
setDictionaryService
public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
- 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
public java.io.Serializable encrypt(org.alfresco.service.namespace.QName propertyQName, java.io.Serializable inbound)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
public java.io.Serializable decrypt(org.alfresco.service.namespace.QName propertyQName, java.io.Serializable inbound)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
public java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> encrypt(java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> inbound)
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
public java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> decrypt(java.util.Map<org.alfresco.service.namespace.QName,java.io.Serializable> inbound)
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
public boolean keyAvailable(java.lang.String keyAlias)
-
backupKeyAvailable
public boolean backupKeyAvailable(java.lang.String keyAlias)
-
-