Skip to content

Commit cd04641

Browse files
committed
测试生成 RSA keys
1 parent 50c215c commit cd04641

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/test/java/com/fengwenyi/javalib/RSAUtilsTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import com.fengwenyi.javalib.encryption.RSAUtils;
55
import org.junit.Test;
66

7+
import java.security.NoSuchAlgorithmException;
8+
79
/**
810
* @author ycq
911
* @since 2019/6/27 11:41
@@ -41,4 +43,13 @@ public void ras(){
4143
}
4244
}
4345

46+
@Test
47+
public void generateKeys() throws NoSuchAlgorithmException {
48+
String[] key = RSAUtils.getKey();
49+
String rsaPrivateKey = key[0];
50+
String rsaPublicKey = key[1];
51+
PrintUtils.info("rsaPrivateKey: "+rsaPrivateKey);
52+
PrintUtils.info("rsaPublicKey: "+rsaPublicKey);
53+
}
54+
4455
}

0 commit comments

Comments
 (0)