public final class StrongIntegerNumberEncryptor extends Object implements IntegerNumberEncryptor
Utility class for easily performing normal-strength encryption of BigInteger objects.
This class internally holds a StandardPBEBigIntegerEncryptor
configured this way:
The required steps to use it are:
setPassword(String)
or
setPasswordCharArray(char[])
).encrypt(BigInteger)
or
decrypt(BigInteger)
operations.This class is thread-safe.
Constructor and Description |
---|
StrongIntegerNumberEncryptor()
Creates a new instance of StrongIntegerNumberEncryptor.
|
Modifier and Type | Method and Description |
---|---|
java.math.BigInteger |
decrypt(java.math.BigInteger encryptedNumber)
Decrypts a number.
|
java.math.BigInteger |
encrypt(java.math.BigInteger number)
Encrypts a number
|
void |
setPassword(String password)
Sets a password.
|
void |
setPasswordCharArray(char[] password)
Sets a password, as a char[].
|
public StrongIntegerNumberEncryptor()
public void setPassword(String password)
password
- the password to be set.public void setPasswordCharArray(char[] password)
password
- the password to be set.public java.math.BigInteger encrypt(java.math.BigInteger number)
encrypt
in interface IntegerNumberEncryptor
number
- the number to be encrypted.StandardPBEBigIntegerEncryptor.encrypt(BigInteger)
public java.math.BigInteger decrypt(java.math.BigInteger encryptedNumber)
decrypt
in interface IntegerNumberEncryptor
encryptedNumber
- the number to be decrypted.StandardPBEBigIntegerEncryptor.decrypt(BigInteger)
Copyright © 2020 The JASYPT team. All Rights Reserved.