public class ExecutorSecurity
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static java.util.Base64.Decoder |
b64Decoder
Decoder for binary data.
|
(package private) static java.util.Base64.Encoder |
b64Encoder
Encoder for binary data.
|
(package private) static java.lang.String |
cipherType |
(package private) static javax.crypto.Cipher |
decipherAES |
(package private) static javax.crypto.Cipher |
encipherAES |
(package private) static java.lang.String |
secretKeyType |
Constructor and Description |
---|
ExecutorSecurity() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
decrypt(java.lang.String str)
Decrypt encrypted string.
|
static java.lang.String |
encrypt(java.lang.String str)
Encrypt string.
|
static byte[] |
generateKeyDataAES()
Use this method to generate a new AES key in byte array form.
|
static void |
main(java.lang.String[] args)
Here's an example that uses this class to generate a key and
use that to encrypt and decrypt a string.
|
static javax.crypto.Cipher encipherAES
static javax.crypto.Cipher decipherAES
static java.lang.String cipherType
static java.lang.String secretKeyType
static final java.util.Base64.Encoder b64Encoder
static final java.util.Base64.Decoder b64Decoder
public static byte[] generateKeyDataAES()
public static java.lang.String encrypt(java.lang.String str)
str
- string to encryptpublic static java.lang.String decrypt(java.lang.String str)
str
- encrypted string.public static void main(java.lang.String[] args)
args
- arguments