@Test public void verify() throws Exception { String signStr = privateKeySign.sign(Constants.source, Constants.charset); System.out.println("签名:" + signStr); boolean verifyFlag = publicKeyVerify.verify(Constants.source, Constants.charset, signStr); System.out.println("验签结果:" + verifyFlag); Assert.assertEquals(true, verifyFlag); }
@Test public void sign() throws Exception { String signStr = privateKeySign.sign(Constants.source, Constants.charset); Assert.assertNotNull(signStr); System.out.println("签名:" + signStr); }