mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
remove EC
This commit is contained in:
@@ -1,14 +1,15 @@
|
||||
package cn.hutool.crypto.test;
|
||||
|
||||
import java.security.KeyPair;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import cn.hutool.crypto.CryptoException;
|
||||
import cn.hutool.crypto.GlobalBouncyCastleProvider;
|
||||
import cn.hutool.crypto.KeyUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Ignore;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.security.KeyPair;
|
||||
import java.security.PrivateKey;
|
||||
import java.security.PublicKey;
|
||||
|
||||
public class KeyUtilTest {
|
||||
|
||||
@@ -23,4 +24,11 @@ public class KeyUtilTest {
|
||||
Assert.assertNotNull(pair);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getRSAPublicKeyTest(){
|
||||
final KeyPair keyPair = KeyUtil.generateKeyPair("RSA");
|
||||
final PrivateKey aPrivate = keyPair.getPrivate();
|
||||
final PublicKey rsaPublicKey = KeyUtil.getRSAPublicKey(aPrivate);
|
||||
Assert.assertEquals(rsaPublicKey, keyPair.getPublic());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user