public class CipherFactory extends Object
createCipher()
will produce a new, identical
Cipher object. Each returned Cipher will encrypt data with
Constructor and Description |
---|
CipherFactory(SecretKey symmetricKey,
int cipherMode,
byte[] initVectorBytes,
Provider cryptoProvider)
Creates a new CipherFactory that will produce ciphers using the specified
key, mode, IV and provider.
|
Modifier and Type | Method and Description |
---|---|
Cipher |
createCipher()
Creates a new Cipher instance based on the crypto parameters specified in
the constructor.
|
int |
getCipherMode() |
Provider |
getCryptoProvider() |
byte[] |
getIV() |
SecretKey |
getSymmetricKey() |
public CipherFactory(SecretKey symmetricKey, int cipherMode, byte[] initVectorBytes, Provider cryptoProvider)
symmetricKey
- The symmetric key used in the ciphers created by this factory.cipherMode
- The mode indicating whether the created ciphers are for
encrypting or decrypting.initVectorBytes
- The optional crypto IV used to initialize the ciphers.cryptoProvider
- The optional Java crypto provider implementation, if an
alternate crypto provider is to be used.public Cipher createCipher()
public Provider getCryptoProvider()
public SecretKey getSymmetricKey()
public int getCipherMode()
public byte[] getIV()
Copyright © 2016. All rights reserved.