Package org.alfresco.encryption
Class DefaultEncryptor
java.lang.Object
org.alfresco.encryption.AbstractEncryptor
org.alfresco.encryption.DefaultEncryptor
- All Implemented Interfaces:
Encryptor
- Since:
- 4.0
- Author:
- Derek Hulley
-
Field Summary
Fields inherited from class org.alfresco.encryption.AbstractEncryptor
cipherAlgorithm, cipherProvider, keyProvider, logger
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Cipher
createCipher
(int mode, String algorithm, String provider, Key key, AlgorithmParameters params) protected Cipher
getCachedCipher
(String keyAlias, int mode, AlgorithmParameters params, Key key) 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
-
Constructor Details
-
DefaultEncryptor
public DefaultEncryptor()Default constructor for IOC
-
-
Method Details
-
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
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
-