public final class RSAAlgorithmBuilder extends Object
GenericEncryptionAlgorithm.GenericEncryptionAlgorithm| Constructor and Description |
|---|
RSAAlgorithmBuilder(AsymmetricEncryptionEngineFactory<RSAKeyParams,RSAKeyParams> engineFactory)
Creates a new builder.
|
| Modifier and Type | Method and Description |
|---|---|
EncryptionAlgorithm |
build()
Builds a new instance of encryption algorithm.
|
RSAAlgorithmBuilder |
bytesRepresentation(BytesRepresentation bytesRepresentation)
Sets how byte arrays will be represented in strings.
|
RSAAlgorithmBuilder |
encoding(String encoding)
Sets encoding for strings in input and output.
|
RSAAlgorithmBuilder |
engineFactory(AsymmetricEncryptionEngineFactory<RSAKeyParams,RSAKeyParams> engineFactory)
Sets factory for encryption engine.
|
RSAAlgorithmBuilder |
privateKey(BigInteger modulus,
BigInteger exponent)
Sets private key for decryption of messages.
|
RSAAlgorithmBuilder |
publicKey(BigInteger modulus,
BigInteger exponent)
Sets public key for encryption of messages.
|
public RSAAlgorithmBuilder(AsymmetricEncryptionEngineFactory<RSAKeyParams,RSAKeyParams> engineFactory)
engineFactory - factory for encryption enginepublic RSAAlgorithmBuilder engineFactory(AsymmetricEncryptionEngineFactory<RSAKeyParams,RSAKeyParams> engineFactory) throws IllegalArgumentException
engineFactory - factory for encryption engineIllegalArgumentException - exception if passed factory is nullpublic RSAAlgorithmBuilder publicKey(BigInteger modulus, BigInteger exponent)
modulus - modulus of keyexponent - exponent of public keypublic RSAAlgorithmBuilder privateKey(BigInteger modulus, BigInteger exponent)
modulus - modulus of keyexponent - exponent of private keyIllegalArgumentException - exception if passed modulus or exponent is nullpublic RSAAlgorithmBuilder bytesRepresentation(BytesRepresentation bytesRepresentation)
HexRepresentation is used.bytesRepresentation - byte array representation strategyIllegalArgumentException - exception if passed BytesRepresentation is nullpublic RSAAlgorithmBuilder encoding(String encoding)
encoding - encoding to be setIllegalArgumentException - exception if given encoding is null or not supportedpublic EncryptionAlgorithm build() throws IllegalArgumentException
EncryptionException - possible exception when encryption algorithm cannot be builtIllegalArgumentExceptionCopyright © 2019. All rights reserved.