public abstract class SymmetricAlgorithmBuilder extends Object implements EncryptionAlgorithmBuilder
SymmetricAlgorithm| Modifier | Constructor and Description |
|---|---|
protected |
SymmetricAlgorithmBuilder(byte[] keyPassword) |
protected |
SymmetricAlgorithmBuilder(CryptoKeyFactory customKeyFactory) |
protected |
SymmetricAlgorithmBuilder(String keyPassword) |
| Modifier and Type | Method and Description |
|---|---|
EncryptionAlgorithm |
build()
Builds a new instance of encryption algorithm.
|
SymmetricAlgorithmBuilder |
combineAlgorithm(CombineAlgorithm combineAlgorithm)
Sets algorithm combining IV and cipher text in output during encryption
and splitting from input during decryption.
|
SymmetricAlgorithmBuilder |
encoding(String encoding)
Sets encoding for strings in input and output.
|
protected abstract String |
getAlgorithm()
Gets a name of algorithm supported by crypto.
|
protected abstract int |
getBlockSize()
Gets a block size of cipher (for CBC).
|
protected abstract int |
getKeySize()
Gets size of the key.
|
protected abstract String |
getShortAlgorithm()
Gets a short name of algorithm supported by crypto keys.
|
SymmetricAlgorithmBuilder |
keyHashIterations(int keyHashIterations)
Sets number of keyHashIterations of hashing for key derivation.
|
SymmetricAlgorithmBuilder |
keySalt(byte[] keySalt)
Sets salt for key derivation.
|
SymmetricAlgorithmBuilder |
keySalt(String keySalt)
Sets salt for key derivation.
|
protected SymmetricAlgorithmBuilder(byte[] keyPassword)
protected SymmetricAlgorithmBuilder(String keyPassword)
protected SymmetricAlgorithmBuilder(CryptoKeyFactory customKeyFactory)
protected abstract String getAlgorithm()
protected abstract String getShortAlgorithm()
protected abstract int getKeySize()
protected abstract int getBlockSize()
public SymmetricAlgorithmBuilder keySalt(byte[] keySalt)
keySalt - salt to be setpublic SymmetricAlgorithmBuilder keySalt(String keySalt)
keySalt - salt to be setpublic SymmetricAlgorithmBuilder keyHashIterations(int keyHashIterations)
keyHashIterations - number of keyHashIterationspublic SymmetricAlgorithmBuilder combineAlgorithm(CombineAlgorithm combineAlgorithm)
combineAlgorithm - combine algorithm for IV and cipher textpublic SymmetricAlgorithmBuilder encoding(String encoding)
encoding - encoding to be setpublic EncryptionAlgorithm build() throws EncryptionException
EncryptionAlgorithmBuilderbuild in interface EncryptionAlgorithmBuilderEncryptionException - possible exception when encryption algorithm cannot be builtCopyright © 2014. All rights reserved.