コード例 #1
0
  public String getPublicKey() {
    String publickey = null;
    try {
      Map<String, Object> keyMap = RSAUtils.genKeyPair();
      publickey = RSAUtils.getPublicKey(keyMap);
      String privateKey = RSAUtils.getPrivateKey(keyMap);
      System.out.println("init userStatusCache - private key:" + privateKey);
      userStatusCache.setPrivateKey(privateKey);
    } catch (Exception e) {
      e.printStackTrace();
    }

    return publickey;
  }
コード例 #2
0
 public int insert(User user) {
   byte[] bytes = null;
   try {
     System.out.println("privatekey: " + userStatusCache.getPrivateKey());
     System.out.println("password: "******"UTF-8");
     System.out.println("md5pw: " + md5pw);
     user.setPassword(md5pw);
     return userMapper.insert(user);
   } catch (Exception e) {
     e.printStackTrace();
     return -1;
   }
 }