Examples of encryptByPublicKey()


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

  }

  @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
View Full Code Here

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

    }
   
   
   
    RSAHelper helper2 = RSAHelper.getInstance(modulus, exponent);
    byte[] destBuf = helper2.encryptByPublicKey(src.getBytes("utf-8"));
    byte[] srcBuf = helper1.decryptByPrivateKey(destBuf);
    Assert.assertEquals(src, new String(srcBuf, "utf-8"));
  }
 
 
View Full Code Here

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

                logger.info("secureKey is ok!");
                String desKey = StringUtils.getRandomNumAndStr(8);
                //设置当前channel属性
                sc.setDesKey(desKey);
                sc.setRights(true);
                handclaspProtocol.setData(sk.encryptByPublicKey(desKey, sc.getClientPublicKey()));
                protocol.setSdpEntity(handclaspProtocol);
                response.setResponseBuffer(protocol.toBytes());
                context.setGaeaResponse(response);
              }else{
                logger.error("It's bad secureKey!");
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.