Package org.hive2hive.core.security

Examples of org.hive2hive.core.security.H2HSignatureFactory.sign()


    FuturePut futurePut = p1.put(lKey).setDomainKey(dKey).setData(cKey, data).setVersionKey(vKey).start();
    futurePut.awaitUninterruptibly();
    Assert.assertTrue(futurePut.isSuccess());

    // create signature with keys 1 having the data object
    byte[] signature1 = factory.sign(keyPair1.getPrivate(), data.buffer()).encode();

    // decrypt signature to get hash of the object
    Cipher rsa = Cipher.getInstance("RSA");
    rsa.init(Cipher.DECRYPT_MODE, keyPair1.getPublic());
    byte[] hash = rsa.doFinal(signature1);
View Full Code Here


    Assert.assertEquals(keyPair1.getPublic(), retData.publicKey());
    // verify that data signature is still the same
    Assert.assertTrue(retData.verify(keyPair1.getPublic(), factory));

    // create signature with keys 1 having the data object
    byte[] signature1 = factory.sign(keyPair1.getPrivate(), intialData.buffer()).encode();

    // decrypt signature to get hash of the object
    Cipher rsa = Cipher.getInstance("RSA");
    rsa.init(Cipher.DECRYPT_MODE, keyPair1.getPublic());
    byte[] hash = rsa.doFinal(signature1);
View Full Code Here

    Assert.assertEquals(keyPair1.getPublic(), retData.publicKey());
    // verify data signature
    Assert.assertTrue(retData.verify(keyPair1.getPublic(), factory));

    // create signature with keys 1 having the data object
    byte[] signature1 = factory.sign(keyPair1.getPrivate(), data.buffer()).encode();

    // decrypt signature to get hash of the object
    Cipher rsa = Cipher.getInstance("RSA");
    rsa.init(Cipher.DECRYPT_MODE, keyPair1.getPublic());
    byte[] hash = rsa.doFinal(signature1);
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.