当前位置:   article > 正文

javaRSA加密解密在线生成公钥私钥方式(工具类)

javaRSA加密解密在线生成公钥私钥方式(工具类)
  1. package org.springblade.common.utils;
  2. import org.apache.commons.codec.binary.Base64;
  3. import org.springframework.stereotype.Component;
  4. import javax.crypto.Cipher;
  5. import java.security.*;
  6. import java.security.interfaces.RSAPrivateKey;
  7. import java.security.interfaces.RSAPublicKey;
  8. import java.security.spec.PKCS8EncodedKeySpec;
  9. import java.security.spec.X509EncodedKeySpec;
  10. import java.util.HashMap;
  11. import java.util.Map;
  12. @Component
  13. public class RsaUtil {
  14. // @Value("${zyplayer.doc.privateKey:}")
  15. private static String privateKey = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMcZUUdstWrwb1wi\n" +
  16. "IuO4Id8W+yBuNZSUJDwpksQKBC+kyWX1kf2PDGtgJyW14pPufsCKuicjumAhsy+I\n" +
  17. "pNALtyMLjUGV9Zg5Bq++A60Q5F3ih/0PIINiT2i+uTVRNWK8SphSrnNSQNPWGlqt\n" +
  18. "LrPsLb7003TCkAnpuQlc8cFidJH7AgMBAAECgYBHWLY8ryMP0FtHm9/+1JQmuriB\n" +
  19. "NZ0zwiZ9/LPgVmqLnDSjue13/JQJwmok5Fnugw
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/451249
推荐阅读
相关标签
  

闽ICP备14008679号