public class EncryptionUtils extends Object
| 构造器和说明 |
|---|
EncryptionUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static String |
AESDecrypt(String cipherText,
SecretKey secretKey,
byte[] iv)
AES decrypting encrypted cipher text.
|
static String |
AESEncrypt(byte[] input,
SecretKey secretKey,
byte[] iv)
AES encrypt input, and output base64 encoded cipher text.
|
static String |
AESEncrypt(String input,
SecretKey secretKey,
byte[] iv)
AES encrypt input, and output base64 encoded cipher text.
|
static SecretKey |
generateAESKey()
Generate a AES secret key.
|
static EncryptionConfig |
generateEncryptionConfig(String apiKey)
Generate a EncryptionConfig.
|
static String |
RSAEncrypt(String input,
String base64AESEncryptKey)
RSA encrypt the input string, return the base64 encoded cipher text.
|
public static String RSAEncrypt(String input, String base64AESEncryptKey) throws ApiException
input - The string to be encrypted.base64AESEncryptKey - The base64 encoded AES encrypt key.ApiExceptionpublic static SecretKey generateAESKey()
public static String AESEncrypt(String input, SecretKey secretKey, byte[] iv) throws ApiException
input - The input stringsecretKey - The AES secret key.iv - The Initialization Vector (IV) to augment the encryption.ApiExceptionpublic static String AESEncrypt(byte[] input, SecretKey secretKey, byte[] iv) throws ApiException
input - The input bytes to encrypt.secretKey - The AES secret key.iv - The Initialization Vector (IV) to augment the encryption.ApiExceptionpublic static String AESDecrypt(String cipherText, SecretKey secretKey, byte[] iv) throws ApiException
cipherText - The cipher text to be decrypted.secretKey - The secret key to use.iv - The Initialization Vector (IV) of the encryption.ApiExceptionpublic static EncryptionConfig generateEncryptionConfig(String apiKey) throws ApiException, NoApiKeyException
Copyright © 2025. All rights reserved.