public abstract class AsymmetricAlgorithmBuilder extends Object implements EncryptionAlgorithmBuilder
AsymmetricAlgorithm| Modifier | Constructor and Description |
|---|---|
protected |
AsymmetricAlgorithmBuilder() |
| Modifier and Type | Method and Description |
|---|---|
EncryptionAlgorithm |
build()
Builds a new instance of encryption algorithm.
|
AsymmetricAlgorithmBuilder |
encoding(String encoding)
Sets encoding for strings in input and output.
|
protected abstract String |
getAlgorithm()
Gets a name of algorithm supported by crypto.
|
AsymmetricAlgorithmBuilder |
keyPair(KeyPair keyPair)
Sets both public and private key for both encryption and decryption.
|
AsymmetricAlgorithmBuilder |
privateKey(BigInteger modulus,
BigInteger exponent)
Sets private key for decryption of messages.
|
AsymmetricAlgorithmBuilder |
privateKey(CryptoKeyFactory privateKeyFactory)
Sets custom factory of private key for decryption of messages.
|
AsymmetricAlgorithmBuilder |
publicKey(BigInteger modulus,
BigInteger exponent)
Sets public key for encryption of messages.
|
AsymmetricAlgorithmBuilder |
publicKey(CryptoKeyFactory publicKeyFactory)
Sets custom factory of public key for encryption of messages.
|
protected abstract String getAlgorithm()
public AsymmetricAlgorithmBuilder publicKey(BigInteger modulus, BigInteger exponent)
modulus - modulus of keyexponent - exponent of public keypublic AsymmetricAlgorithmBuilder publicKey(CryptoKeyFactory publicKeyFactory)
publicKeyFactory - factory of public keypublic AsymmetricAlgorithmBuilder privateKey(BigInteger modulus, BigInteger exponent)
modulus - modulus of keyexponent - exponent of private keypublic AsymmetricAlgorithmBuilder privateKey(CryptoKeyFactory privateKeyFactory)
privateKeyFactory - factory of private keypublic AsymmetricAlgorithmBuilder keyPair(KeyPair keyPair)
keyPair - key pairpublic AsymmetricAlgorithmBuilder 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.