Package | Description |
---|---|
cn.hutool.crypto.asymmetric |
非对称加密的实现,包括RSA等
|
Modifier and Type | Method and Description |
---|---|
static KeyType |
KeyType.valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static KeyType[] |
KeyType.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
SM2.decrypt(byte[] data,
KeyType keyType)
解密
|
byte[] |
RSA.decrypt(byte[] bytes,
KeyType keyType) |
byte[] |
AsymmetricDecryptor.decrypt(byte[] bytes,
KeyType keyType)
解密
|
byte[] |
AsymmetricCrypto.decrypt(byte[] data,
KeyType keyType) |
default byte[] |
AsymmetricDecryptor.decrypt(InputStream data,
KeyType keyType)
解密
|
default byte[] |
AsymmetricDecryptor.decrypt(String data,
KeyType keyType)
从Hex或Base64字符串解密,编码为UTF-8格式
|
default byte[] |
AsymmetricDecryptor.decryptFromBcd(String data,
KeyType keyType)
解密BCD
|
default byte[] |
AsymmetricDecryptor.decryptFromBcd(String data,
KeyType keyType,
Charset charset)
Deprecated.
由于对于ASCII的编码解码有缺陷,且这种BCD实现并不规范,因此会在6.0.0中移除
|
default String |
AsymmetricDecryptor.decryptStr(String data,
KeyType keyType)
解密为字符串,密文需为Hex(16进制)或Base64字符串
|
default String |
AsymmetricDecryptor.decryptStr(String data,
KeyType keyType,
Charset charset)
解密为字符串,密文需为Hex(16进制)或Base64字符串
|
default String |
AsymmetricDecryptor.decryptStrFromBcd(String data,
KeyType keyType)
Deprecated.
由于对于ASCII的编码解码有缺陷,且这种BCD实现并不规范,因此会在6.0.0中移除
|
default String |
AsymmetricDecryptor.decryptStrFromBcd(String data,
KeyType keyType,
Charset charset)
Deprecated.
由于对于ASCII的编码解码有缺陷,且这种BCD实现并不规范,因此会在6.0.0中移除
|
byte[] |
SM2.encrypt(byte[] data,
KeyType keyType)
加密,SM2非对称加密的结果由C1,C3,C2三部分组成,其中:
C1 生成随机数的计算出的椭圆曲线点
C3 SM3的摘要值
C2 密文数据
|
byte[] |
RSA.encrypt(byte[] data,
KeyType keyType) |
byte[] |
AsymmetricEncryptor.encrypt(byte[] data,
KeyType keyType)
加密
|
byte[] |
AsymmetricCrypto.encrypt(byte[] data,
KeyType keyType) |
default byte[] |
AsymmetricEncryptor.encrypt(InputStream data,
KeyType keyType)
加密
|
default byte[] |
AsymmetricEncryptor.encrypt(String data,
Charset charset,
KeyType keyType)
加密
|
default byte[] |
AsymmetricEncryptor.encrypt(String data,
KeyType keyType)
加密,使用UTF-8编码
|
default byte[] |
AsymmetricEncryptor.encrypt(String data,
String charset,
KeyType keyType)
加密
|
default String |
AsymmetricEncryptor.encryptBase64(byte[] data,
KeyType keyType)
编码为Base64字符串
|
default String |
AsymmetricEncryptor.encryptBase64(InputStream data,
KeyType keyType)
编码为Base64字符串
|
default String |
AsymmetricEncryptor.encryptBase64(String data,
Charset charset,
KeyType keyType)
编码为Base64字符串
|
default String |
AsymmetricEncryptor.encryptBase64(String data,
KeyType keyType)
编码为Base64字符串,使用UTF-8编码
|
default String |
AsymmetricEncryptor.encryptBcd(String data,
KeyType keyType)
Deprecated.
由于对于ASCII的编码解码有缺陷,且这种BCD实现并不规范,因此会在6.0.0中移除
|
default String |
AsymmetricEncryptor.encryptBcd(String data,
KeyType keyType,
Charset charset)
Deprecated.
由于对于ASCII的编码解码有缺陷,且这种BCD实现并不规范,因此会在6.0.0中移除
|
default String |
AsymmetricEncryptor.encryptHex(byte[] data,
KeyType keyType)
编码为Hex字符串
|
default String |
AsymmetricEncryptor.encryptHex(InputStream data,
KeyType keyType)
编码为Hex字符串
|
default String |
AsymmetricEncryptor.encryptHex(String data,
Charset charset,
KeyType keyType)
编码为Hex字符串
|
default String |
AsymmetricEncryptor.encryptHex(String data,
KeyType keyType)
编码为Hex字符串
|
protected Key |
BaseAsymmetric.getKeyByType(KeyType type)
根据密钥类型获得相应密钥
|
Copyright © 2024. All rights reserved.