public final class SymmetricAlgorithmBuilder extends Object
GenericEncryptionAlgorithm.GenericEncryptionAlgorithm| Constructor and Description |
|---|
SymmetricAlgorithmBuilder(SymmetricEncryptionEngineFactory engineFactory,
byte[] keyPassword,
int keySize,
int blockSize)
Creates a new builder.
|
| Modifier and Type | Method and Description |
|---|---|
EncryptionAlgorithm |
build()
Builds a new instance of encryption algorithm.
|
SymmetricAlgorithmBuilder |
bytesRepresentation(BytesRepresentation bytesRepresentation)
Sets how byte arrays will be represented in strings.
|
SymmetricAlgorithmBuilder |
encoding(String encoding)
Sets encoding for strings in input and output.
|
SymmetricAlgorithmBuilder |
engineFactory(SymmetricEncryptionEngineFactory engineFactory)
Sets factory for encryption engine.
|
SymmetricAlgorithmBuilder |
ivAndOutputCombining(CombiningSplitting ivOutputCombining)
Sets algorithm combining initialization vector and cipher text in output during encryption
and splitting from input during decryption.
|
SymmetricAlgorithmBuilder |
ivFactory(ByteArrayFactory ivFactory)
Sets algorithm for generation of initialization vector for every message.
|
SymmetricAlgorithmBuilder |
keyHashIterations(int keyHashIterations)
Sets number of iterations of hashing for key derivation.
|
SymmetricAlgorithmBuilder |
keySalt(byte[] keySalt)
Sets salt for key derivation.
|
SymmetricAlgorithmBuilder |
keySalt(String keySalt)
Sets salt for key derivation.
|
public SymmetricAlgorithmBuilder(SymmetricEncryptionEngineFactory engineFactory, byte[] keyPassword, int keySize, int blockSize)
engineFactory - factory for encryption enginekeyPassword - key passwordkeySize - size of the key (in bits)blockSize - size of the block (in bits)public SymmetricAlgorithmBuilder engineFactory(SymmetricEncryptionEngineFactory engineFactory) throws IllegalArgumentException
engineFactory - factory for encryption engineIllegalArgumentException - exception if passed factory is nullpublic SymmetricAlgorithmBuilder keySalt(byte[] keySalt) throws IllegalArgumentException
keySalt - salt to be setIllegalArgumentException - exception if passed key salt is nullpublic SymmetricAlgorithmBuilder keySalt(String keySalt) throws IllegalArgumentException
keySalt - salt to be setIllegalArgumentException - exception if passed key salt is nullpublic SymmetricAlgorithmBuilder keyHashIterations(int keyHashIterations) throws IllegalArgumentException
keyHashIterations - number of keyHashIterationsIllegalArgumentException - exception if passed iterations are lower than 1public SymmetricAlgorithmBuilder ivFactory(ByteArrayFactory ivFactory) throws IllegalArgumentException
ivAndOutputCombining(CombiningSplitting) into the final output.ivFactory - factory for initialization vectorIllegalArgumentException - exception if passed ByteArrayFactory is nullpublic SymmetricAlgorithmBuilder ivAndOutputCombining(CombiningSplitting ivOutputCombining) throws IllegalArgumentException
ivOutputCombining - combine/split algorithm for IV and cipher textIllegalArgumentException - exception if passed CombiningSplitting is nullpublic SymmetricAlgorithmBuilder bytesRepresentation(BytesRepresentation bytesRepresentation) throws IllegalArgumentException
HexRepresentation is used.bytesRepresentation - byte array representation strategyIllegalArgumentException - exception if passed BytesRepresentation is nullpublic SymmetricAlgorithmBuilder encoding(String encoding) throws IllegalArgumentException
encoding - encoding to be setIllegalArgumentException - exception if given encoding is null or not supportedpublic EncryptionAlgorithm build() throws IllegalArgumentException
IllegalArgumentExceptionCopyright © 2016. All rights reserved.