public class KeyAgreementUtil extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
KeyAgreementUtil.SessionData
会话令牌数据容器类
包含加密密钥、随机数和会话令牌
|
| Constructor and Description |
|---|
KeyAgreementUtil() |
| Modifier and Type | Method and Description |
|---|---|
static String |
aesGcmDecrypt(byte[] key,
byte[] iv,
byte[] cipherBytes) |
static String |
aesGcmDecryptBase64List(byte[] key,
byte[] nonce,
String ciphertext) |
static String |
aesGcmDecryptBase64String(byte[] key,
byte[] nonce,
String ciphertext) |
static String |
decryptStringWithKey(byte[] key,
byte[] nonce,
String encryptedContent) |
static boolean |
decryptValidate(String ciphertext) |
static String |
encryptStringWithKey(byte[] key,
byte[] nonce,
String plaintext) |
static List<String> |
extractBase64Blocks(String ciphertext) |
static KeyAgreementUtil.SessionData |
generateEciesKeyPair(PublicKey publicKey) |
static byte[] |
hkdf(byte[] sharedSecret,
byte[] salt,
byte[] info,
int length) |
static byte[] |
marshalEcPublicKey(ECPublicKey publicKey) |
static byte[] |
toUnsignedBigEndian(BigInteger value,
int length) |
public static KeyAgreementUtil.SessionData generateEciesKeyPair(PublicKey publicKey) throws GeneralSecurityException
GeneralSecurityExceptionpublic static byte[] hkdf(byte[] sharedSecret,
byte[] salt,
byte[] info,
int length)
throws GeneralSecurityException
GeneralSecurityExceptionpublic static byte[] marshalEcPublicKey(ECPublicKey publicKey)
public static byte[] toUnsignedBigEndian(BigInteger value, int length)
public static boolean decryptValidate(String ciphertext)
public static String decryptStringWithKey(byte[] key, byte[] nonce, String encryptedContent)
public static String encryptStringWithKey(byte[] key, byte[] nonce, String plaintext)
public static String aesGcmDecryptBase64String(byte[] key, byte[] nonce, String ciphertext)
public static String aesGcmDecrypt(byte[] key, byte[] iv, byte[] cipherBytes) throws GeneralSecurityException
GeneralSecurityExceptionpublic static String aesGcmDecryptBase64List(byte[] key, byte[] nonce, String ciphertext)
Copyright © 2025. All rights reserved.