public class AliceContextBuilder
extends java.lang.Object
AliceContext
.
Constructor and Description |
---|
AliceContextBuilder()
|
Modifier and Type | Method and Description |
---|---|
AliceContext
|
build()
Creates an
AliceContext with the
arguments supplied to this builder.
|
AliceContextBuilder |
setAlgorithm(AliceContext.Algorithm algorithm)
Sets the cipher algorithm.
|
AliceContextBuilder |
setGcmTagLength(AliceContext.GcmTagLength gcmTagLength)
Sets the GCM tag length.
|
AliceContextBuilder |
setIterations(int iterations)
Sets the iterations for the Pbkdf algorithm.
|
AliceContextBuilder |
setIvLength(int ivLength)
Sets the initialization vector.
|
AliceContextBuilder |
setKeyLength(AliceContext.KeyLength keyLength)
Sets the cipher key length.
|
AliceContextBuilder |
setMacAlgorithm(AliceContext.MacAlgorithm macAlgorithm)
Sets the MAC algorithm.
|
AliceContextBuilder |
setMode(AliceContext.Mode mode)
Sets the cipher algorithm mode.
|
AliceContextBuilder |
setPadding(AliceContext.Padding padding)
Sets the cipher algorithm padding.
|
AliceContextBuilder |
setPbkdf(AliceContext.Pbkdf pbkdf)
Sets the Pbkdf algorithm.
|
public AliceContextBuilder setAlgorithm(AliceContext.Algorithm algorithm)
AES
and is the
only supported algorithm
algorithm
- the AliceContext.Algorithm
AliceContextBuilder
public AliceContextBuilder setMode(AliceContext.Mode mode)
CTR
mode
- the AliceContext.Mode
AliceContextBuilder
public AliceContextBuilder setPadding(AliceContext.Padding padding)
NoPadding
padding
- the AliceContext.Padding
AliceContextBuilder
public AliceContextBuilder setKeyLength(AliceContext.KeyLength keyLength)
256
keyLength
- the AliceContext.KeyLength
AliceContextBuilder
public AliceContextBuilder setPbkdf(AliceContext.Pbkdf pbkdf)
PBKDF2WithHmacSHA512
pbkdf
- the AliceContext.Pbkdf
AliceContextBuilder
public AliceContextBuilder setMacAlgorithm(AliceContext.MacAlgorithm macAlgorithm)
HmacSHA512
macAlgorithm
- the AliceContext.MacAlgorithm
AliceContextBuilder
public AliceContextBuilder setIvLength(int ivLength)
16
See IvParameterSpec
or GCMParameterSpec
ivLength
- the length of the initialization vectorAliceContextBuilder
public AliceContextBuilder setGcmTagLength(AliceContext.GcmTagLength gcmTagLength)
128
gcmTagLength
- the tag length used for GCM modes of operationAliceContextBuilder
public AliceContextBuilder setIterations(int iterations)
10000
iterations
- the iterations used with the Pbkdf algorithmAliceContextBuilder
public AliceContext build()
AliceContext
with the arguments supplied to this builder.
AliceContext