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 Cipher
createCipher(int mode, String algorithm, String provider, Key key, AlgorithmParameters params)
protected Cipher
getCachedCipher(String keyAlias, int mode, AlgorithmParameters params, Key key)
Cipher
getCipher(String keyAlias, AlgorithmParameters params, int mode)
Factory method to be written by implementations to construct and initialize physical ciphering objects.void
init()
boolean
keyAvailable(String keyAlias)
void
setCacheCiphers(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:
init
in 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:AbstractEncryptor
Factory method to be written by implementations to construct and initialize physical ciphering objects.- Specified by:
getCipher
in classAbstractEncryptor
- Parameters:
keyAlias
- the key aliasparams
- algorithm-specific parametersmode
- the cipher mode- Returns:
- Cipher
-
keyAvailable
public boolean keyAvailable(String keyAlias)
-
-