Пример #1
0
  /**
   * @descript 客户端签到获取密钥
   * @param listener
   */
  public void getDes(CallBackListener<AuthenticateInfo> listener) {

    HashMap<String, Object> map = new HashMap<String, Object>();
    map.put("ClientCode", FunctionCode.DESKEY_CLIENTCODE);
    try {
      map.put("UserId", Des3Utils.des3EncodeECB(FunctionCode.DEFAULTKEY, FunctionCode.UID));
      map.put("UserPwd", Des3Utils.des3EncodeECB(FunctionCode.DEFAULTKEY, FunctionCode.PWD));
    } catch (Exception e1) {
      e1.printStackTrace();
    }
    InvokeRequest request = new InvokeRequest(map, FunctionCode.DESKEY, listener);
    request.invoke();
  }
Пример #2
0
 private HashMap<String, Object> createMap() {
   HashMap<String, Object> map = new HashMap<String, Object>();
   String desKey = XhtApplication.getInstance().getAuthenticateInfo().getDesKey();
   map.put("ClientCode", FunctionCode.DESKEY_CLIENTCODE);
   String workGUid = XhtApplication.getInstance().getAuthenticateInfo().getWorkGuid();
   try {
     map.put("WorkGuid", Des3Utils.des3EncodeECB(desKey, workGUid)); // 正式密钥加密
   } catch (Exception e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
   return map;
 }
Пример #3
0
 private String createInputBody(HashMap<String, ?> inputBodyMap) throws Exception {
   String inputBodyJson = JSON.toJSONString(inputBodyMap);
   String desKey = XhtApplication.getInstance().getAuthenticateInfo().getDesKey();
   String inputBody = Des3Utils.des3EncodeECB(desKey, inputBodyJson);
   return inputBody;
 }