public class SM2ToSM3TextEncryptor extends SM2TextEncryptor
| 限定符和类型 | 字段和说明 |
|---|---|
protected DefaultRandomStringGenerator |
randomStringGenerator |
protected SM3TextEncryptor |
sm3TextEncryptor |
protected boolean |
toSM3
控制解密后是否发送SM3消息摘要字符串,如果为false,则返回明文。
|
logger| 构造器和说明 |
|---|
SM2ToSM3TextEncryptor(EncryptionProperties encryptionProperties) |
SM2ToSM3TextEncryptor(EncryptionProperties encryptionProperties,
boolean toSM3) |
SM2ToSM3TextEncryptor(cn.aotcloud.smcrypto.Sm2Utils sm2Utils,
EncryptionProperties encryptionProperties)
已过时。
|
SM2ToSM3TextEncryptor(cn.aotcloud.smcrypto.Sm2Utils sm2Utils,
EncryptionProperties encryptionProperties,
boolean toSM3)
已过时。
|
SM2ToSM3TextEncryptor(cn.aotcloud.smcrypto.Sm2Utils sm2Utils,
String pubKeyHex,
String prvKeyHex)
已过时。
|
SM2ToSM3TextEncryptor(cn.aotcloud.smcrypto.Sm2Utils sm2Utils,
String pubKeyHex,
String prvKeyHex,
boolean toSM3)
已过时。
|
SM2ToSM3TextEncryptor(String pubKeyHex,
String prvKeyHex) |
SM2ToSM3TextEncryptor(String pubKeyHex,
String prvKeyHex,
boolean toSM3) |
| 限定符和类型 | 方法和说明 |
|---|---|
String |
decrypt(String encryptedText) |
String |
decryptWithSM2(String encryptedText)
SM2算法解密
|
String |
encrypt(String text) |
protected String |
encryptInternal(String text) |
String |
sm2DecryptAndSm3VerifyRP(String cipherText)
通过自定义防篡改协议密文串校验并获取原始SM3签名串
|
String |
sm2DecryptAndSm3VerifyRP(String cipherText,
String split)
通过自定义防篡改协议密文串校验并获取原始SM3签名串
|
protected String |
sm3Encrypt(String text) |
createSm2Util, getPrvKeyHex, getPubKeyHex, getRsaPublicCode, getSm2Utilsprotected boolean toSM3
protected SM3TextEncryptor sm3TextEncryptor
protected DefaultRandomStringGenerator randomStringGenerator
@Deprecated public SM2ToSM3TextEncryptor(cn.aotcloud.smcrypto.Sm2Utils sm2Utils, EncryptionProperties encryptionProperties)
sm2Utils - encryptionProperties - @Deprecated public SM2ToSM3TextEncryptor(cn.aotcloud.smcrypto.Sm2Utils sm2Utils, EncryptionProperties encryptionProperties, boolean toSM3)
sm2Utils - encryptionProperties - toSM3 - @Deprecated public SM2ToSM3TextEncryptor(cn.aotcloud.smcrypto.Sm2Utils sm2Utils, String pubKeyHex, String prvKeyHex)
sm2Utils - pubKeyHex - prvKeyHex - @Deprecated public SM2ToSM3TextEncryptor(cn.aotcloud.smcrypto.Sm2Utils sm2Utils, String pubKeyHex, String prvKeyHex, boolean toSM3)
sm2Utils - pubKeyHex - prvKeyHex - toSM3 - public SM2ToSM3TextEncryptor(EncryptionProperties encryptionProperties)
public SM2ToSM3TextEncryptor(EncryptionProperties encryptionProperties, boolean toSM3)
public String encrypt(String text)
encrypt 在接口中 org.springframework.security.crypto.encrypt.TextEncryptorencrypt 在类中 SM2TextEncryptorprotected String encryptInternal(String text)
text - 明文public String decrypt(String encryptedText)
decrypt 在接口中 org.springframework.security.crypto.encrypt.TextEncryptordecrypt 在类中 SM2TextEncryptorpublic String decryptWithSM2(String encryptedText)
encryptedText - SM2解密后的密文public String sm2DecryptAndSm3VerifyRP(String cipherText)
cipherText - 自定义防篡改加密串: SM2(SM3(明文) + | + 8位随机字符串 + | + 明文)privateKeyHex - 私钥16进制字符串public String sm2DecryptAndSm3VerifyRP(String cipherText, String split)
cipherText - 自定义防篡改加密串: SM2(SM3(明文) + 分隔符 + 8位随机字符串 + 分隔符 + 明文)privateKeyHex - 私钥16进制字符串split - 分隔符Copyright © 2023. All rights reserved.