Class EncryptionUtils
java.lang.Object
com.alibaba.dashscope.legacy_2x.utils.EncryptionUtils
Deprecated.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringAESDecrypt(String cipherText, SecretKey secretKey, byte[] iv) Deprecated.AES decrypting encrypted cipher text.static StringAESEncrypt(byte[] input, SecretKey secretKey, byte[] iv) Deprecated.AES encrypt input, and output base64 encoded cipher text.static StringAESEncrypt(String input, SecretKey secretKey, byte[] iv) Deprecated.AES encrypt input, and output base64 encoded cipher text.static SecretKeyDeprecated.Generate a AES secret key.static EncryptionConfiggenerateEncryptionConfig(String apiKey) Deprecated.Generate a EncryptionConfig.static EncryptionConfiggenerateEncryptionConfig(String apiKey, String baseHttpUrl) Deprecated.Generate a EncryptionConfig, fetching the public key from the given base URL.static StringRSAEncrypt(String input, String base64AESEncryptKey) Deprecated.RSA encrypt the input string, return the base64 encoded cipher text.
-
Constructor Details
-
EncryptionUtils
public EncryptionUtils()Deprecated.
-
-
Method Details
-
RSAEncrypt
Deprecated.RSA encrypt the input string, return the base64 encoded cipher text.- Parameters:
input- The string to be encrypted.base64AESEncryptKey- The base64 encoded AES encrypt key.- Returns:
- The base64 encoded cipher of the input.
- Throws:
ApiException
-
generateAESKey
Deprecated.Generate a AES secret key.- Returns:
- The AES SecretKey.
-
AESEncrypt
Deprecated.AES encrypt input, and output base64 encoded cipher text.- Parameters:
input- The input stringsecretKey- The AES secret key.iv- The Initialization Vector (IV) to augment the encryption.- Returns:
- The base64 encoded cipher text.
- Throws:
ApiException
-
AESEncrypt
Deprecated.AES encrypt input, and output base64 encoded cipher text.- Parameters:
input- The input bytes to encrypt.secretKey- The AES secret key.iv- The Initialization Vector (IV) to augment the encryption.- Returns:
- The base64 encoded cipher text.
- Throws:
ApiException
-
AESDecrypt
public static String AESDecrypt(String cipherText, SecretKey secretKey, byte[] iv) throws ApiException Deprecated.AES decrypting encrypted cipher text.- Parameters:
cipherText- The cipher text to be decrypted.secretKey- The secret key to use.iv- The Initialization Vector (IV) of the encryption.- Returns:
- The plain text of cipher text.
- Throws:
ApiException
-
generateEncryptionConfig
public static EncryptionConfig generateEncryptionConfig(String apiKey) throws ApiException, NoApiKeyException Deprecated.Generate a EncryptionConfig.- Throws:
ApiExceptionNoApiKeyException
-
generateEncryptionConfig
public static EncryptionConfig generateEncryptionConfig(String apiKey, String baseHttpUrl) throws ApiException, NoApiKeyException Deprecated.Generate a EncryptionConfig, fetching the public key from the given base URL.- Throws:
ApiExceptionNoApiKeyException
-