package com.mjlogin.service;
 
import org.apache.commons.codec.binary.Base64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.gson.JsonObject;

import javax.crypto.Cipher;
import java.security.*;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
 
/**
 * Created By Rock-Ayl on 2020-10-14
 * RSA工具包
 * 0.生成秘钥
 * 1.加密
 * 2.解密
 */
public class RSAUtils {
 
    protected static Logger logger = LoggerFactory.getLogger(RSAUtils.class);

    public static String appIdPublicKey = "MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEApqOWMi9qWZ1e0TfzsuP+cstS6J7O+cRSX+m/dF7gHp4Yxp0iEOHCFskb7XkCTyqXCazVVkzrw5u1h/oXLCTBNtRlzR2BtFpX+Ad1i8PoObur5yqt6Yr3A/JmUV6BQzQw9pH+9pLPUtdO3nArF4bj80SqC2FqTSGj9Jx2qoM1E2zDSyAhPyEPc27wtakbZKzp2pteT/Gd7yteXk4vEf/MNS0iWOxtC/lAYwNZUzlE6dD/7iXb5L6GnFormDnrZE5P70PKjU9iRj3DZ0CZvh9JriTfub8yrFkHqs1BOS9s+RT0q+ngh2+mrAKcPIUn3MyBUjV0ZTR2yuRZZH/OAGCeyu2RYDVLqWlq4CUZNeW4agbOh84R1/upBLl4nu9JT94w3AahYyG5emC6a7YcNfbhqHFo7eFaf0WkpJ1NvLxsLHNt3RpIUPZzuz795nzxgAR+mGNSv+3jPr299cxJn/ass/CoWTHXrwSVLEcLHto70Dj3TRDCCa88hMrz2j89RRoIR6M4zCG7sfKg3PA3iteqJV+HlBh+gz5fmQ8QCaH3i15MSMtWsW4EhcPs0sIahuB1vXI3A3um/1Md8vuvkoHrJMT52uMlz+YQGw9b6MsPcBa9BEKV/WCBYhAYYauAaiLk1rrUYNrS9H/u7biYSg7N0DzxnDc4L0hbSc8n0Kaxcq8CAwEAAQ==";
    private static String appIdPrivateKey = "MIIJQgIBADANBgkqhkiG9w0BAQEFAASC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l/il7Nb05EbZrRbQz/5VbiZxc+S4asfFrrU0d++gjiluiAbBBhgtQSi+eNZuJ2wrBxjvN3W9d14XMmZKDg21Knu7tDUwOlEfCPVMZ/nJ+9YU6mnEvme29UgpI4RbEIIWPuDW3DavbaOvZ/cYP+0m2pxU3mETwDbVpbM3LimJ4JOBIs7XhV2UqEUfRVCYiuZUkydOCs1TgTJRJC5qgYpx4wUZ0ja7t9jP3klg/vjjyA1SDnC98bQLR5QzVJE1LvI2Rr3AHfZS0hckg0WAR87D1R8sGjmQ0TUi4qanpQYhEL4dBH8a6TX/xssobM7M+XgFsGiT4fWG18JhJM98rhVEk2AUaXgnFNf3OyLP+NuYrqjYamuug00s2azCl/rQCkvnLWO4W+lPn27ZinnBRg1+r2fNws7dPPa/8tWScRcTtfaidYsQP2lnYJvFgc299HdQL7iFgL336NihUxll09Hhm7vf8+N0ZP5TLE8SRoSfHNgHup6k9YG5e+V9bW4VckQFgPPBlHSS0mDEOvD9d54+F1cBg/sG8XMduW5WhfroYsMbRzB9a4rIfctn6yqpM+ot2EW8CKgiOVM5lJQhBwX5rMKnMTaApt6EIigY6jRVFNCOtQPDZ9prLBsp3asQxf7Vg9kfrVUCAwEAAQ==";
    //RSA-私钥
    private static String PrivateKey="MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQCZkuZviloPXcTa4654VK1PWDw6cDglBiQ3g9mX+KXs1vTkRtmtFtDP/lVuJnFz5Lhqx8WutTR376COKW6IBsEGGC1BKL541m4nbCsHGO83db13XhcyZkoODbUqe7u0NTA6UR8I9Uxn+cn71hTqacS+Z7b1SCkjhFsQghY+4NbcNq9to69n9xg/7SbanFTeYRPANtWlszcuKYngk4EizteFXZSoRR9FUJiK5lSTJ04KzVOBMlEkLmqBinHjBRnSNru32M/eSWD++OPIDVIOcL3xtAtHlDNUkTUu8jZGvcAd9lLSFySDRYBHzsPVHywaOZDRNSLipqelBiEQvh0EfxrpNf/Gyyhszsz5eAWwaJPh9Y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qoXK56UB//YTmB7glyyNpO4zCeBakU37plzZnFG5ehVI6FIojXm4wqcG/HsRSY7YOD4FEgV9QKJL/0IxrPGK3ue+PRgiKNek7wwzh1v8X+1KtE27EE/BWevbxEKTm+8mKhu0Ii1/CXteaqrFowFH7m1hZAltrabG+7WvcxjgWndJQpgG+CspiEM4hesAPkrNAdPGsahS03FzN+fv27X8HKcpG3wzcSfEJrHFGmc0DOqwqsCggEAJ+ICyEbmQ94Ibtha4QJSeFCgVO29eM0/O8e8beGv3+zrxrt5kQLFrrvJIke2iAnRbmBkX0BDyTMQ5LdexGp1R1272Q9HAysjsWitw4GHV4CZK6dezm7slDTx/8z6bD1B2oeFboyuevB04sFZVUY3qzbuIEQYpvU9nwThxP/sVq+1v2ilXPD2iSXdVScGkNUVmpF4asiteYvS6feohV/HMMm71D/CeENcHfgSiqZyW1hHsDxgSwYOQcCpEdrXTF7ly/SpKDjYfmljCPvFwpECO8pNG90/e/CY+6H7jpAS00AFRzK+/bs6JW5gQE1zC/O05DB77oREVfk9NI6eElY4ZA==";

//    //初始化
//    static {
//        try {
//            //KeyPairGenerator类用于生成公钥和私钥对,基于RSA算法生成对象
//            KeyPairGenerator keyPairGen = KeyPairGenerator.getInstance("RSA");
//            //初始化密钥对生成器，密钥大小为96-1024位
//            keyPairGen.initialize(4096, new SecureRandom());
//            //生成一对密钥
//            KeyPair keyPair = keyPairGen.generateKeyPair();
//            //公钥存储
//            appIdPublicKey = new String(Base64.encodeBase64(keyPair.getPublic().getEncoded()));
//            //私钥存储
//            appIdPrivateKey = new String(Base64.encodeBase64((keyPair.getPrivate().getEncoded())));
//        } catch (NoSuchAlgorithmException e) {
//            logger.error("RSA生成秘钥异常:[{}]", e);
//        }
//    }
 
    /**
     * RSA公钥加密
     *
     * @param str       加密字符串
     * @param publicKey 公钥
     * @return 密文
     * @throws Exception 加密过程中的异常信息
     */
    public static String encrypt(String str, String publicKey) throws Exception {
        Cipher cipher = Cipher.getInstance("RSA");
        cipher.init(Cipher.ENCRYPT_MODE, KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(Base64.decodeBase64(publicKey))));
        return Base64.encodeBase64String(cipher.doFinal(str.getBytes("UTF-8")));
    }
 
    /**
     * RSA私钥解密
     *
     * @param str        加密字符串
     * @param privateKey 私钥
     * @return 铭文
     * @throws Exception 解密过程中的异常信息
     */
    public static String decrypt(String str) throws Exception {
        Cipher cipher = Cipher.getInstance("RSA");
        cipher.init(Cipher.DECRYPT_MODE, KeyFactory.getInstance("RSA").generatePrivate(new PKCS8EncodedKeySpec(Base64.decodeBase64(PrivateKey))));
        return new String(cipher.doFinal(Base64.decodeBase64(str.getBytes("UTF-8"))));
    }
    
    
    /**
     * RSA公钥加密
     *
     * @param str       加密字符串
     * @param publicKey 公钥
     * @return 密文
     * @throws Exception 加密过程中的异常信息
     */
    public static String appIdencrypt(String str, String appIdpublicKey) throws Exception {
        Cipher cipher = Cipher.getInstance("RSA");
        cipher.init(Cipher.ENCRYPT_MODE, KeyFactory.getInstance("RSA").generatePublic(new X509EncodedKeySpec(Base64.decodeBase64(appIdpublicKey))));
        return Base64.encodeBase64String(cipher.doFinal(str.getBytes("UTF-8")));
    }
 
    /**
     * RSA私钥解密
     *
     * @param str        加密字符串
     * @param privateKey 私钥
     * @return 铭文
     * @throws Exception 解密过程中的异常信息
     */
    public static String appIddecrypt(String str) throws Exception {
        Cipher cipher = Cipher.getInstance("RSA");
        cipher.init(Cipher.DECRYPT_MODE, KeyFactory.getInstance("RSA").generatePrivate(new PKCS8EncodedKeySpec(Base64.decodeBase64(appIdPrivateKey))));
        return new String(cipher.doFinal(Base64.decodeBase64(str.getBytes("UTF-8"))));
    }
    
 
    //测试
    public static void main(String[] args) throws Exception {
        //加密字符串
        String message = "{\"appid\":\"wx40ac640ee6bd1116\",\"appSecret\":\"cde030153f5b97874c5e6063c70c0f97\"}";
        System.out.println("随机生成的公钥为:" + appIdPublicKey);
        System.out.println("随机生成的私钥为:" + appIdPrivateKey);
        String messageEn = appIdencrypt(message, appIdPublicKey);
        System.out.println("加密前:" + message);
        System.out.println("加密后:" + "U8sAHDB1miX5\\/0lfynztmYE0iXfaSeqe7QqjYsPNK5uT4iMwAwUtR\\/vhDkztREiEiuDX9CG2J9KIICDCGUWc9L6a5qvCOg99KW8AZr8lcNjKJgGPaeG7tx7JS2pkEU34lcTVQFwCrrZsvPctQS9jZQTapb303P\\/VdaQH+Ha\\/hCZTGHArr6A3TnyH1hs6nP4eeRd+staMAErBc4VYdzf1pk095YcIUsKjNgslBXgqIHYaitTn184A0NE025e4XQS7rrnnZkHXzpzyAK1hTaFNQDHy7IY6xbY8f37JVZU\\/aJYdbYa1jIdr6IlqhiZJy4RFryqyODIZmolOMm7g1gC2AehRbbRknPKbLRF7DtENjW72yWHDY4tafuXKaAfRvOYd+f5JX46xgtKySjoS74Yp+bj3DnxW4+Gz\\/UgyYuyASAN3LLwAu\\/tU\\/EHYe2f3ewzsEVmE+XJjczhdXLetd3\\/S39fuSfWdGTFjv5Mg6xv\\/hF6kgWlgSB2AP1GQy\\/qn4Bxeymdi6+rjyWj9JCx9hjI8zYcRRnzfaNkpcTO\\/v9V8BU2RWpZlt1M3GL23LozrIv5Y1LqrCPD35zmWytrHF9x6J832S82qVi7T8aw\\/8o6s1cCuk8gj6iW2VyTiDVSCiuHRZZtRKVWqiYIi+OEO2ZuNNWb74dtcyafwL\\/DyD+\\/Tico=");
        String messageDe = appIddecrypt("U8sAHDB1miX5\\\\/0lfynztmYE0iXfaSeqe7QqjYsPNK5uT4iMwAwUtR\\\\/vhDkztREiEiuDX9CG2J9KIICDCGUWc9L6a5qvCOg99KW8AZr8lcNjKJgGPaeG7tx7JS2pkEU34lcTVQFwCrrZsvPctQS9jZQTapb303P\\\\/VdaQH+Ha\\\\/hCZTGHArr6A3TnyH1hs6nP4eeRd+staMAErBc4VYdzf1pk095YcIUsKjNgslBXgqIHYaitTn184A0NE025e4XQS7rrnnZkHXzpzyAK1hTaFNQDHy7IY6xbY8f37JVZU\\\\/aJYdbYa1jIdr6IlqhiZJy4RFryqyODIZmolOMm7g1gC2AehRbbRknPKbLRF7DtENjW72yWHDY4tafuXKaAfRvOYd+f5JX46xgtKySjoS74Yp+bj3DnxW4+Gz\\\\/UgyYuyASAN3LLwAu\\\\/tU\\\\/EHYe2f3ewzsEVmE+XJjczhdXLetd3\\\\/S39fuSfWdGTFjv5Mg6xv\\\\/hF6kgWlgSB2AP1GQy\\\\/qn4Bxeymdi6+rjyWj9JCx9hjI8zYcRRnzfaNkpcTO\\\\/v9V8BU2RWpZlt1M3GL23LozrIv5Y1LqrCPD35zmWytrHF9x6J832S82qVi7T8aw\\\\/8o6s1cCuk8gj6iW2VyTiDVSCiuHRZZtRKVWqiYIi+OEO2ZuNNWb74dtcyafwL\\\\/DyD+\\\\/Tico=");
        System.out.println("还原后:" + messageDe);
        
        
//		String appid = "wx40ac640ee6bd1116";
//		String appSecret = "cde030153f5b97874c5e6063c70c0f97";
//		JsonObject object = new JsonObject();
//		object.addProperty("appid", appid);
//		object.addProperty("appSecret", appSecret);
//		String encryptText = RSAUtils.encrypt(appid.toString(), RSAUtils.appIdPublicKey);
//		System.out.println("加密后的数据："+encryptText);

    }
 
}