|
|
|
|
package com.ynxbd.common;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.crypto.asymmetric.AsymmetricAlgorithm;
|
|
|
|
|
import cn.hutool.crypto.asymmetric.RSA;
|
|
|
|
|
|
|
|
|
|
public class TestA {
|
|
|
|
|
private static final String PUB_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC5klqI5STWTcbfjR093j+hvCEjNlZMQscIJg8jxZGqKW84AdFmSqPWEPu9ilqP+QUASiVSZ1QevGr2DWODFZ8Zw35aDA2bqCEprUx81gDdVPO7H7Bij+r8zAg8fT2c0Bi5rFq0xWMEQiTI+CyWwc5prOpquJU/P5yauEAdkRzlDwIDAQAB";
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) throws Exception{
|
|
|
|
|
// String content = "533103198212184014";
|
|
|
|
|
// byte[] bytes = RSAHelper.enPKCS1PaddingToByte(content, PUB_KEY);
|
|
|
|
|
// System.out.println("【Java最终hex】:" + HexUtil.encodeHexStr(bytes));
|
|
|
|
|
// RSA rsa = new RSA(AsymmetricAlgorithm.RSA_ECB_PKCS1.getValue(),
|
|
|
|
|
// "你的私钥base64",
|
|
|
|
|
// "你的公钥base64");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public static void main(String[] args) throws Exception {
|
|
|
|
|
// String content = "533103198212184014";
|
|
|
|
|
// String encrypt = RSAHelper.enPKCS1Padding(content, PUB_KEY);
|
|
|
|
|
// System.out.println(HexUtil.encodeHexStr(encrypt));
|
|
|
|
|
// }
|
|
|
|
|
}
|