- java.lang.Object
-
- io.helidon.common.crypto.SymmetricCipher.Builder
-
- All Implemented Interfaces:
Builder<SymmetricCipher>,Supplier<SymmetricCipher>
- Enclosing class:
- SymmetricCipher
public static class SymmetricCipher.Builder extends Object implements Builder<SymmetricCipher>
Builder of theSymmetricCipher.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SymmetricCipher.Builderalgorithm(String algorithm)Set algorithm which should be used.SymmetricCipherbuild()Build the instance from this builder.SymmetricCipher.BuilderkeySize(int keySize)Set size of the key (in bits) which should be generated.SymmetricCipher.BuildernumberOfIterations(int numberOfIterations)Number of iterations which will be used for key derivation from the password.SymmetricCipher.Builderpassword(char[] password)Set password upon which the cryptography key will be generated.SymmetricCipher.Builderprovider(String provider)Set provider of the algorithm.
-
-
-
Method Detail
-
algorithm
public SymmetricCipher.Builder algorithm(String algorithm)
Set algorithm which should be used.
Default value isSymmetricCipher.ALGORITHM_AES_GCM.- Parameters:
algorithm- algorithm to be used- Returns:
- updated builder instance
-
provider
public SymmetricCipher.Builder provider(String provider)
Set provider of the algorithm.- Parameters:
provider- provider to be used- Returns:
- updated builder instance
-
password
public SymmetricCipher.Builder password(char[] password)
Set password upon which the cryptography key will be generated.- Parameters:
password- base password- Returns:
- updated builder instance
-
keySize
public SymmetricCipher.Builder keySize(int keySize)
Set size of the key (in bits) which should be generated. Default value is 256 bit.- Parameters:
keySize- size of the key- Returns:
- updated builder instance
-
numberOfIterations
public SymmetricCipher.Builder numberOfIterations(int numberOfIterations)
Number of iterations which will be used for key derivation from the password. Default value is 10000.- Parameters:
numberOfIterations- number of iterations- Returns:
- updated builder instance
-
build
public SymmetricCipher build()
Description copied from interface:BuilderBuild the instance from this builder.- Specified by:
buildin interfaceBuilder<SymmetricCipher>- Returns:
- instance of the built type
-
-