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