码迷,mamicode.com
首页 > 其他好文 > 详细

idea 安装mybatis plugin (mybatis插件)

时间:2017-10-20 18:21:48      阅读:131      评论:0      收藏:0      [点我收藏+]

标签:bat   src   技术分享   builder   ret   code   blocks   http   mode   

技术分享

 

安装上以后需要破解,先找到下面的文件

技术分享

 

打开文件,设置其中的key 和 value :

技术分享

 

这里面的key 和 value 哪儿来呢?

使用下面的代码运行一下即可得到:

 

public class App 
{
    public static void main(String[] args) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException {
        KeyPairGenerator keygen = KeyPairGenerator.getInstance("RSA");
        keygen.initialize(512);
        KeyPair kp = keygen.generateKeyPair();
        RSAPrivateKey privateKey = (RSAPrivateKey)kp.getPrivate();
        RSAPublicKey publicKey = (RSAPublicKey)kp.getPublic();
        System.out.println("KEY:\n" + bytesToHexString(publicKey.getEncoded()) + "\n");
        Cipher cipher = Cipher.getInstance("RSA");
        cipher.init(Cipher.ENCRYPT_MODE,privateKey);
        System.out.println("RESULT:\n" + bytesToHexString(cipher.doFinal("EamonSec".getBytes())) + "\n");
    }
    private static String bytesToHexString(byte[] src){
        StringBuilder stringBuilder = new StringBuilder("");
        if (src == null || src.length <= 0) {
            return null;
        }
        for (byte aSrc : src) {
            int v = aSrc & 0xFF;
            String hv = Integer.toHexString(v);
            if (hv.length() < 2) {
                stringBuilder.append(0);
            }
            stringBuilder.append(hv);
        }
        return stringBuilder.toString();
    }

}

 

idea 安装mybatis plugin (mybatis插件)

标签:bat   src   技术分享   builder   ret   code   blocks   http   mode   

原文地址:http://www.cnblogs.com/sigm/p/7700303.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!