public final class BasicDecimalNumberEncryptor extends Object implements DecimalNumberEncryptor
Utility class for easily performing normal-strength encryption of BigDecimal objects.
This class internally holds a StandardPBEBigDecimalEncryptor
configured this way:
The required steps to use it are:
setPassword(String)
or
setPasswordCharArray(char[])
).encrypt(BigDecimal)
or
decrypt(BigDecimal)
operations.This class is thread-safe.
Constructor and Description |
---|
BasicDecimalNumberEncryptor()
Creates a new instance of BasicDecimalNumberEncryptor.
|
Modifier and Type | Method and Description |
---|---|
BigDecimal |
decrypt(BigDecimal encryptedNumber)
Decrypts a number.
|
BigDecimal |
encrypt(BigDecimal number)
Encrypts a number
|
void |
setPassword(String password)
Sets a password.
|
void |
setPasswordCharArray(char[] password)
Sets a password, as a char[].
|
public BasicDecimalNumberEncryptor()
public void setPassword(String password)
password
- the password to be set.public void setPasswordCharArray(char[] password)
password
- the password to be set.public BigDecimal encrypt(BigDecimal number)
encrypt
in interface DecimalNumberEncryptor
number
- the number to be encrypted.StandardPBEBigDecimalEncryptor.encrypt(BigDecimal)
public BigDecimal decrypt(BigDecimal encryptedNumber)
decrypt
in interface DecimalNumberEncryptor
encryptedNumber
- the number to be decrypted.StandardPBEBigDecimalEncryptor.decrypt(BigDecimal)
Copyright © 2017 JBoss by Red Hat. All rights reserved.