Package org.apache.shiro.crypto.cipher
Class AbstractSymmetricCipherService
java.lang.Object
org.apache.shiro.crypto.cipher.JcaCipherService
org.apache.shiro.crypto.cipher.AbstractSymmetricCipherService
- All Implemented Interfaces:
CipherService
- Direct Known Subclasses:
DefaultBlockCipherService
Base abstract class for supporting symmetric key cipher algorithms.
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGenerates a newKeysuitable for this CipherService'salgorithmby callinggenerateNewKey(128)(uses a 128 bit size by default).generateNewKey(int keyBitSize) Generates a newKeyof the specified size suitable for this CipherService (based on thealgorithmNameusing the JDKKeyGenerator.Methods inherited from class org.apache.shiro.crypto.cipher.JcaCipherService
createParameterSpec, decrypt, decrypt, encrypt, encrypt, ensureSecureRandom, generateInitializationVector, getAlgorithmName, getDefaultSecureRandom, getInitializationVectorSize, getKeySize, getSecureRandom, getStreamingBufferSize, getTransformationString, isGenerateInitializationVectors, isGenerateInitializationVectors, setGenerateInitializationVectors, setInitializationVectorSize, setKeySize, setSecureRandom, setStreamingBufferSize
-
Constructor Details
-
AbstractSymmetricCipherService
-
-
Method Details
-
generateNewKey
Generates a newKeysuitable for this CipherService'salgorithmby callinggenerateNewKey(128)(uses a 128 bit size by default).- Returns:
- a new
Key, 128 bits in length.
-
generateNewKey
Generates a newKeyof the specified size suitable for this CipherService (based on thealgorithmNameusing the JDKKeyGenerator.- Parameters:
keyBitSize- the bit size of the key to create- Returns:
- the created key suitable for use with this CipherService
-