|
@@ -32,12 +32,12 @@ public class RsaUtils {
|
|
|
public static void main(String[] args) {
|
|
|
RsaUtils rsa = new RsaUtils();
|
|
|
KeyPairInfo keyPair = getKeyPair();
|
|
|
- String publicKey = keyPair.getPublicKey();
|
|
|
- String privateKey = keyPair.getPrivateKey();
|
|
|
+ //String publicKey = keyPair.getPublicKey();
|
|
|
+ //String privateKey = keyPair.getPrivateKey();
|
|
|
System.out.println("公钥:"+publicKey);
|
|
|
System.out.println("私钥:"+privateKey);
|
|
|
|
|
|
- String ciphertext = rsa.encipher("0291FC698", publicKey);
|
|
|
+ String ciphertext = rsa.encipher("4DKKPRO_0291FC698", publicKey);
|
|
|
System.out.println(String.format("密文:"+ciphertext));
|
|
|
String deTxt = rsa.decipher(ciphertext, privateKey);
|
|
|
System.out.println(deTxt);
|