mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
change to KeyPair
This commit is contained in:
@@ -21,6 +21,7 @@ import org.dromara.hutool.crypto.bc.PemUtil;
|
||||
import org.junit.jupiter.api.Assertions;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.security.KeyPair;
|
||||
import java.security.PublicKey;
|
||||
|
||||
public class SignUtilTest {
|
||||
@@ -68,6 +69,6 @@ public class SignUtilTest {
|
||||
"-----END CERTIFICATE-----";
|
||||
|
||||
final PublicKey key = (PublicKey) PemUtil.readPemKey(IoUtil.toUtf8Stream(publicKey));
|
||||
new Sign(SignAlgorithm.SHA256withRSA, null, key);
|
||||
new Sign(SignAlgorithm.SHA256withRSA, new KeyPair(key, null));
|
||||
}
|
||||
}
|
||||
|
@@ -186,7 +186,7 @@ public class RSATest {
|
||||
+ "wfMhrJksfeKbIaMjNLS9b8JynIaXg9iCiyOHmgkMl5gAbPoH/ULXqSKwzBw5mJ2GW1gBlyaSfV3AkA/RJC+adIjsRGg"//
|
||||
+ "JOkiRjSmPpGv3FOhl9fsBPjupZBEIuoMWOC8GXK/73DHxwmfNmN7C9+sIi4RBcjEeQ5F5FHZ";
|
||||
|
||||
final RSA rsa = new RSA(PRIVATE_KEY, null);
|
||||
final RSA rsa = new RSA(PRIVATE_KEY, (String) null);
|
||||
|
||||
final String a = "2707F9FD4288CEF302C972058712F24A5F3EC62C5A14AD2FC59DAB93503AA0FA17113A020EE4EA35EB53F" //
|
||||
+ "75F36564BA1DABAA20F3B90FD39315C30E68FE8A1803B36C29029B23EB612C06ACF3A34BE815074F5EB5AA3A"//
|
||||
|
Reference in New Issue
Block a user