Package org.alfresco.encryption
Class DefaultEncryptor
- java.lang.Object
-
- org.alfresco.encryption.AbstractEncryptor
-
- org.alfresco.encryption.DefaultEncryptor
-
- All Implemented Interfaces:
Encryptor
public class DefaultEncryptor extends AbstractEncryptor
- Since:
- 4.0
- Author:
- Derek Hulley
-
-
Field Summary
-
Fields inherited from class org.alfresco.encryption.AbstractEncryptor
cipherAlgorithm, cipherProvider, keyProvider, logger
-
-
Constructor Summary
Constructors Constructor Description DefaultEncryptor()Default constructor for IOC
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected CiphercreateCipher(int mode, String algorithm, String provider, Key key, AlgorithmParameters params)protected CiphergetCachedCipher(String keyAlias, int mode, AlgorithmParameters params, Key key)CiphergetCipher(String keyAlias, AlgorithmParameters params, int mode)Factory method to be written by implementations to construct and initialize physical ciphering objects.voidinit()booleankeyAvailable(String keyAlias)voidsetCacheCiphers(boolean cacheCiphers)-
Methods inherited from class org.alfresco.encryption.AbstractEncryptor
decodeAlgorithmParameters, decrypt, decrypt, decryptObject, encrypt, encryptObject, getCipherAlgorithm, getCipherProvider, getKeyProvider, resetCipher, sealObject, setCipherAlgorithm, setCipherProvider, setKeyProvider, unsealObject
-
-
-
-
Method Detail
-
init
public void init()
- Overrides:
initin classAbstractEncryptor
-
setCacheCiphers
public void setCacheCiphers(boolean cacheCiphers)
-
createCipher
protected Cipher createCipher(int mode, String algorithm, String provider, Key key, AlgorithmParameters params) throws NoSuchAlgorithmException, NoSuchPaddingException, NoSuchProviderException, InvalidKeyException, InvalidAlgorithmParameterException
-
getCachedCipher
protected Cipher getCachedCipher(String keyAlias, int mode, AlgorithmParameters params, Key key) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, NoSuchProviderException, InvalidAlgorithmParameterException
-
getCipher
public Cipher getCipher(String keyAlias, AlgorithmParameters params, int mode)
Description copied from class:AbstractEncryptorFactory method to be written by implementations to construct and initialize physical ciphering objects.- Specified by:
getCipherin classAbstractEncryptor- Parameters:
keyAlias- the key aliasparams- algorithm-specific parametersmode- the cipher mode- Returns:
- Cipher
-
keyAvailable
public boolean keyAvailable(String keyAlias)
-
-