public class AESGCMUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
AES_KEY_SIZE |
static int |
GCM_IV_LENGTH |
static int |
GCM_TAG_LENGTH |
| Constructor and Description |
|---|
AESGCMUtil() |
| Modifier and Type | Method and Description |
|---|---|
String |
decryptGCM(String password,
String encryptedtext) |
String |
encryptGCM(String password,
String plaintext) |
static SecretKeySpec |
getSecretKeySpec(String password) |
public static final int GCM_TAG_LENGTH
public static final int GCM_IV_LENGTH
public static final int AES_KEY_SIZE
public String encryptGCM(String password, String plaintext)
password: - secret keyplaintext: - clear textpublic String decryptGCM(String password, String encryptedtext)
password: - secret keyencryptedtext: - ciphertextpublic static SecretKeySpec getSecretKeySpec(String password) throws NoSuchAlgorithmException, UnsupportedEncodingException
password: - secret keyNoSuchAlgorithmExceptionUnsupportedEncodingExceptionCopyright © 2023 openGauss. All rights reserved.