mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-24 18:04:54 +08:00
fix comment
This commit is contained in:
parent
21aa56a982
commit
6064586ef9
@ -137,23 +137,6 @@ public class RSATest {
|
||||
Assert.assertEquals("我是一段测试aaaa", StrUtil.str(decrypt2, CharsetUtil.UTF_8));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void rsaBcdTest() {
|
||||
final String text = "我是一段测试aaaa";
|
||||
|
||||
final RSA rsa = new RSA();
|
||||
|
||||
// 公钥加密,私钥解密
|
||||
final String encryptStr = rsa.encryptBcd(text, KeyType.PublicKey);
|
||||
final String decryptStr = StrUtil.utf8Str(rsa.decryptFromBcd(encryptStr, KeyType.PrivateKey));
|
||||
Assert.assertEquals(text, decryptStr);
|
||||
|
||||
// 私钥加密,公钥解密
|
||||
final String encrypt2 = rsa.encryptBcd(text, KeyType.PrivateKey);
|
||||
final String decrypt2 = StrUtil.utf8Str(rsa.decryptFromBcd(encrypt2, KeyType.PublicKey));
|
||||
Assert.assertEquals(text, decrypt2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void rsaBase64Test() {
|
||||
final String textBase = "我是一段特别长的测试";
|
||||
|
@ -75,18 +75,6 @@ public class SM2Test {
|
||||
Assert.assertEquals("我是一段测试aaaa", StrUtil.str(decrypt, CharsetUtil.UTF_8));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sm2BcdTest() {
|
||||
final String text = "我是一段测试aaaa";
|
||||
|
||||
final SM2 sm2 = SmUtil.sm2();
|
||||
|
||||
// 公钥加密,私钥解密
|
||||
final String encryptStr = sm2.encryptBcd(text, KeyType.PublicKey);
|
||||
final String decryptStr = StrUtil.utf8Str(sm2.decryptFromBcd(encryptStr, KeyType.PrivateKey));
|
||||
Assert.assertEquals(text, decryptStr);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sm2Base64Test() {
|
||||
final String textBase = "我是一段特别长的测试";
|
||||
|
Loading…
Reference in New Issue
Block a user