public static String rsa() {
String publicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDG03gR1w6i3E6h6+N9F2///BnRrkzPc7RT4qZKKl2b/rolym0EYl3QZTsIV5oQngT93TLtld7EK5svdwUabX6kzqd8yDDChZXS/E7/FrufN6Hwf9S3O3ZzkhEyd45HmRHV4aNRFsS/NviEZx83D6FR94l0SPnomvPkVqM8UnafnQIDAQAB";
String privateKey = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMbTeBHXDqLcTqHr430Xb//8GdGuTM9ztFPipkoqXZv+uiXKbQRiXdBlOwhXmhCeBP3dMu2V3sQrmy93BRptfqTOp3zIMMKFldL8Tv8Wu583ofB/1Lc7dnOSETJ3jkeZEdXho1EWxL82+IRnHzcPoVH3iXRI+eia8+RWozxSdp+dAgMBAAECgYAJjtfqT6LR/HJBQXQ9qrdFIIrjNBRYMrE8CRzCWvgGDEBJmcoU2F+3KW6lj4SGAPqvc4dDuZ0sZAZBSWDy7MmWL+Zz2z44sulxsOsb3DJqIyBSAr5D6mhrRmu7MJA5AGgDHo/2gn+9Cji2JQBHBFe18BzJdr2tIM4uAYTVB6EW8QJBAPCrnHohSDtgLSmHrbORP/cIS8OOF/M3PsYfHZ3cpdrKk2zs1rXAHJq80GlmhSQx8tezx6wt63Cph0reiHbOMRkCQQDTfYqahFR0NTFFfTBfSJKQEqoiRYMnOrjkkOOgFv6cBwYd16pnqTfNISSYkBsOcDO09qiMILW96MoJONCV458lAkEAmMrqueK9X+zMX0xjK9hwOp5Ks2lXrTKKqO+CNwGpTkFD3WhzW8oOnvJ2giPzLSqE2QqrHpW8nrcSTKcBDiQTqQJABORmjGR7P6TrWtwmfk3Ddim4XcqV2hZ1qHPhkBZ4FUvkTFRs0LENZWVa31yWA6N8zrbV90fabGYyJjx2NsFpMQJARtRflzJjWc/49nzu+om41bz9Ngg07/S8Rxe8AlZbSlCxggmp/KUBcoVgNJCa5qGsX2AvTOCXaHngp+YLtHHPBQ==";
String s = SecureUtil.rsa(privateKey, publicKey).encryptBase64("nishishui".getBytes(), KeyType.PublicKey);
logger.info(s);
String sq = SecureUtil.rsa(privateKey, publicKey).decryptStr("D4EpMXfrh3jbL89bBQaDjk0H9ZJFEG7aoMsectUpZciUoSZGUnscexZ4/yP1/bFlyYG5Fei5Wq/OzCkcdHkpHZkdMav3/GBe3zkMzMsNd3B0pD9is/xYzKXLlGERtM5lqrmAkCzXCA5qBHsKZctnG2gLvX1SAnJs43bezaCZ8=", KeyType.PrivateKey);
logger.info(sq);
return null;
}
public static void main(String[] args) {
String loginUserId = JwtUtils.getUserId("eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyX2lkIjoiMTAwMTIwMjIwNDE5MDAwMDE2MSIsInVzZXJfa2V5IjoiYTExYWU3YzItYThhNy00NGY4LWExMjMtODdmNTBmYzI4ZDQyIiwidXNlcm5hbWUiOiIxNzc3NDA3MDM2NiJ9.fjyl2VyHp8SY3MGRnUgmDPm_oJXt5tz0JZ2RVuTucl4Xzic9_FVO1pfrVThYT1qvgVLdPJIM7zHx_Di2aWbu4g");
System.out.println(loginUserId);
}
|