Package org.wildfly.security.util
Class PasswordBasedEncryptionUtil.Builder
java.lang.Object
org.wildfly.security.util.PasswordBasedEncryptionUtil.Builder
- Enclosing class:
- PasswordBasedEncryptionUtil
Builder class to build
PasswordBasedEncryptionUtil class with all necessary parameters to support
password based encryption algorithms.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionalgorithmParameters(AlgorithmParameters algorithmParameters) Set algorithm parameters forCipherinitialization.Set the alphabet to encode/decode result of encryption/decryption.build()Builds PBE utility class instancecipherIteration(int cipherIteration) Set the number of iterations forCiphercipherSalt(byte[] cipherSalt) Set salt for theCiphercipherSalt(String cipherSalt) Set salt for theCipherSet decryption mode for chosenCipherUse padding when encoding/decoding binary data.Set encryption mode for chosenCipheriteration(int iteration) Set number of iteration for key derivation.iv(byte[] iv) Set initialization vector for use with AES algorithmsSet initialization vector for use with AES algorithmskeyAlgorithm(String keyAlgorithm) Set the key derivation algorithm.keyLength(int keyLength) Set the key length.parametersAlgorithm(String parametersAlgorithm) Set the name of parameter's algorithm to initialize theCipherpassword(char[] password) Set password to use to generate the encryption keySet password to use to generate the encryption keyUse PicketBox compatibility mode for producing exact output as using PBE for MASK- purpose.Set the JCA provider name which contains all classes needed by built utility class.Set the JCA provider which contains all classes needed by built utility class.salt(byte[] salt) Set salt for key derivation.Set salt for key derivation.transformation(String transformation) Transformation name to use asCipherparameter.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
password
Set password to use to generate the encryption key- Parameters:
password- the password- Returns:
- this Builder
-
password
Set password to use to generate the encryption key- Parameters:
password- the password- Returns:
- this Builder
-
iv
Set initialization vector for use with AES algorithms- Parameters:
iv- the raw IV- Returns:
- this Builder
-
iv
Set initialization vector for use with AES algorithms- Parameters:
encodedIV- IV encoded usingAlphabetset in this builder (or default)- Returns:
- this Builder
-
transformation
Transformation name to use asCipherparameter.- Parameters:
transformation- the name of transformation- Returns:
- this Builder
-
parametersAlgorithm
Set the name of parameter's algorithm to initialize theCipher- Parameters:
parametersAlgorithm- the name of parameter's algorithm- Returns:
- this Builder
-
salt
Set salt for key derivation.- Parameters:
salt- the salt- Returns:
- this Builder
-
salt
Set salt for key derivation.- Parameters:
salt- the salt- Returns:
- this Builder
-
picketBoxCompatibility
Use PicketBox compatibility mode for producing exact output as using PBE for MASK- purpose. Problem is that PicketBox is using different base64 than standard. Default isfalse.- Returns:
- this Builder
-
encodingPadded
Use padding when encoding/decoding binary data.- Returns:
- this Builder
-
iteration
Set number of iteration for key derivation.- Parameters:
iteration- the number of iterations- Returns:
- this Builder
-
keyAlgorithm
Set the key derivation algorithm.- Parameters:
keyAlgorithm- the algorithm- Returns:
- this Builder
-
keyLength
Set the key length.- Parameters:
keyLength- the length- Returns:
- this Builder
-
cipherIteration
Set the number of iterations forCipher- Parameters:
cipherIteration- number of iterations- Returns:
- this Builder
-
cipherSalt
Set salt for theCipher- Parameters:
cipherSalt- the salt- Returns:
- this Builder
-
cipherSalt
Set salt for theCipher- Parameters:
cipherSalt- the salt- Returns:
- this Builder
-
provider
Set the JCA provider which contains all classes needed by built utility class.- Parameters:
provider- the provider- Returns:
- this Builder
-
provider
Set the JCA provider name which contains all classes needed by built utility class.- Parameters:
providerName- the provider name- Returns:
- this Builder
-
alphabet
Set the alphabet to encode/decode result of encryption/decryption.- Parameters:
alphabet- theAlphabetinstance- Returns:
- this Builder
-
encryptMode
Set encryption mode for chosenCipher- Returns:
- this Builder
-
decryptMode
Set decryption mode for chosenCipher- Returns:
- this Builder
-
algorithmParameters
public PasswordBasedEncryptionUtil.Builder algorithmParameters(AlgorithmParameters algorithmParameters) Set algorithm parameters forCipherinitialization.- Parameters:
algorithmParameters- the algorithm parameters instance in form required by the usedCipher- Returns:
- this Builder
-
build
Builds PBE utility class instance- Returns:
- PBE utility class instance
PasswordBasedEncryptionUtil - Throws:
GeneralSecurityException- when something goes wrong while initializing encryption related objects
-