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