Examples of decryptByPrivateKey()


Examples of com.bj58.spat.gaea.server.secure.RSAHelper.decryptByPrivateKey()

  @Test
  public void testDecryptByPriKey() throws Exception {
    RSAHelper helper = RSAHelper.getInstance();
    byte[] destBuf = helper.encryptByPublicKey(src.getBytes("utf-8"));
    byte[] srcBuf = helper.decryptByPrivateKey(destBuf);
    Assert.assertEquals(src, new String(srcBuf, "utf-8"));
  }
 
  @Test
  public void testPublicKey() throws Exception {
View Full Code Here

Examples of com.bj58.spat.gaea.server.secure.SecureKey.decryptByPrivateKey()

              String clientSecureInfo = handclaspProtocol.getData();
              if(null == clientSecureInfo || "".equals(clientSecureInfo)){
                logger.warn("get client secureKey warn!");
              }
              //授权文件客户端原文(服务器私钥解密)
              String sourceInfo = sk.decryptByPrivateKey(clientSecureInfo, sc.getServerPrivateKey());
              //校验授权文件是否相同
              //判断是否合法,如果合法服务器端生成DES密钥,通过客户端提供的公钥进行加密传送给客户端
              if(global.containsSecureMap(sourceInfo)){
                logger.info("secureKey is ok!");
                String desKey = StringUtils.getRandomNumAndStr(8);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.