public final class ECDHKeyExchanger extends Object
| 构造器和说明 |
|---|
ECDHKeyExchanger() |
| 限定符和类型 | 方法和说明 |
|---|---|
static ECPrivateKey |
decodePrivateKey(byte[] privateKey)
取得私钥
|
static ECPublicKey |
decodePublicKey(byte[] publicKey)
取得公钥
|
static byte[] |
decrypt(byte[] data,
SecretKey secretKey)
解密
|
static byte[] |
encode(ECPrivateKey key)
ECPrivateKey convert to byte array
|
static byte[] |
encode(ECPublicKey key)
ECPublicKey convert to byte array
|
static byte[] |
encrypt(byte[] data,
SecretKey secretKey)
加密
|
static SecretKey |
genSecretKey(byte[] bPriKey,
byte[] aPubKey)
双方公私钥生成(协商)对称密钥
|
static SecretKey |
genSecretKey(ECPrivateKey bPriKey,
ECPublicKey aPubKey)
双方公私钥生成(协商)对称密钥
|
static org.apache.commons.lang3.tuple.Pair<ECPublicKey,ECPrivateKey> |
initPartAKey() |
static org.apache.commons.lang3.tuple.Pair<ECPublicKey,ECPrivateKey> |
initPartAKey(int keySize)
初始化甲方密钥
|
static org.apache.commons.lang3.tuple.Pair<ECPublicKey,ECPrivateKey> |
initPartBKey(byte[] partAPubKey) |
static org.apache.commons.lang3.tuple.Pair<ECPublicKey,ECPrivateKey> |
initPartBKey(ECPublicKey partAPublicKey)
初始化乙方密钥
|
public static org.apache.commons.lang3.tuple.Pair<ECPublicKey,ECPrivateKey> initPartAKey()
public static org.apache.commons.lang3.tuple.Pair<ECPublicKey,ECPrivateKey> initPartAKey(int keySize)
keySize - the key size: 192/224/256/384/521public static org.apache.commons.lang3.tuple.Pair<ECPublicKey,ECPrivateKey> initPartBKey(byte[] partAPubKey)
public static org.apache.commons.lang3.tuple.Pair<ECPublicKey,ECPrivateKey> initPartBKey(ECPublicKey partAPublicKey)
partAPublicKey - 甲方公钥public static byte[] encode(ECPublicKey key)
key - the ECPublicKeypublic static byte[] encode(ECPrivateKey key)
key - the ECPrivateKeypublic static ECPrivateKey decodePrivateKey(byte[] privateKey)
privateKey - public static ECPublicKey decodePublicKey(byte[] publicKey)
publicKey - public static SecretKey genSecretKey(byte[] bPriKey, byte[] aPubKey)
bPriKey - aPubKey - public static SecretKey genSecretKey(ECPrivateKey bPriKey, ECPublicKey aPubKey)
bPriKey - aPubKey - public static byte[] encrypt(byte[] data,
SecretKey secretKey)
data - 待加密数据secretKey - 双方公私钥协商的对称密钥public static byte[] decrypt(byte[] data,
SecretKey secretKey)
data - 待解密数据secretKey - 双方公私钥协商的对称密钥Copyright © 2023. All rights reserved.