From ea06e68fdccef91e180449286e912277800e3d51 Mon Sep 17 00:00:00 2001
From: wzy <wzy19931122ai@163.com>
Date: Mon, 04 Jan 2021 23:12:26 +0800
Subject: [PATCH] modify
---
src/test/java/com/xcong/excoin/RSATest.java | 16 +++++++++++++++-
1 files changed, 15 insertions(+), 1 deletions(-)
diff --git a/src/test/java/com/xcong/excoin/RSATest.java b/src/test/java/com/xcong/excoin/RSATest.java
index 02dd114..ca7e81d 100644
--- a/src/test/java/com/xcong/excoin/RSATest.java
+++ b/src/test/java/com/xcong/excoin/RSATest.java
@@ -7,10 +7,13 @@
import cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.asymmetric.KeyType;
import cn.hutool.crypto.asymmetric.RSA;
+import cn.hutool.crypto.asymmetric.Sign;
+import cn.hutool.crypto.asymmetric.SignAlgorithm;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
+import java.math.BigDecimal;
import java.security.KeyPair;
/**
@@ -18,7 +21,7 @@
* @date 2020-05-12
**/
@Slf4j
-@SpringBootTest
+@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
public class RSATest {
private String publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCFU26floADA4PSEmE99u1YD30P3LAP6c7XYRASejCte+uOUfveSGHip2cgwpElu4y/r8PKAbclvs8j3y0g4MhjQbRjsiK8O2PKPaTWW+bHWPapPAhTuRHDMVFV6sajZ4dcg7mZ9+zPqG2RkvXi993v7kcTYq8hpE20/+Do7gwFowIDAQAB";
@@ -94,4 +97,15 @@
byte[] decrypt = rsa.decrypt(aByte, KeyType.PrivateKey);
}
+ @Test
+ public void md5Test() {
+ String md5str = SecureUtil.md5("123456");
+ log.info("{}", md5str);
+ }
+
+ @Test
+ public void bigdecimalTest() {
+ BigDecimal bigDecimal = new BigDecimal("123.12345678").setScale(4, BigDecimal.ROUND_DOWN);
+ log.info("--->{}", bigDecimal);
+ }
}
--
Gitblit v1.9.1