Package org.hive2hive.core.security

Examples of org.hive2hive.core.security.H2HSignatureCodec.decode()


    // verify data signature
    Assert.assertTrue(p1.get(lKey).setDomainKey(dKey).setContentKey(cKey).setVersionKey(vKey).start()
        .awaitUninterruptibly().getData().verify(keyPair1.getPublic(), factory));

    // change data signature to keys 2, assign the reused hash from signature
    data = new Data().ttlSeconds(ttl).signature(codec.decode(signatureNew));
    // don't forget to set signed flag, create meta data
    data.signed(true).duplicateMeta();
    FuturePut futurePutMeta = p1.put(lKey).setDomainKey(dKey).putMeta().setData(cKey, data)
        .setVersionKey(vKey).start();
    futurePutMeta.awaitUninterruptibly();
View Full Code Here


    rsa = Cipher.getInstance("RSA");
    rsa.init(Cipher.ENCRYPT_MODE, keyPair2.getPrivate());
    byte[] signatureNew = rsa.doFinal(hash);

    // change data signature to keys 2, assign the reused hash from signature
    data = new Data().ttlSeconds(ttl).signature(codec.decode(signatureNew)).setProtectedEntry();
    // don't forget to set signed flag, create meta data
    data.signed(true).duplicateMeta();
    // put meta using content content protection key 1 to sign message
    FuturePut futurePutMeta = p1.put(lKey).setDomainKey(dKey).putMeta().setData(cKey, data)
        .setVersionKey(vKey).keyPair(keyPair1).start();
View Full Code Here

    rsa = Cipher.getInstance("RSA");
    rsa.init(Cipher.ENCRYPT_MODE, keyPair2.getPrivate());
    byte[] signatureNew = rsa.doFinal(hash);

    // change data signature to keys 2, assign the reused hash from signature
    data = new Data().ttlSeconds(ttl).signature(codec.decode(signatureNew)).setProtectedEntry();
    // don't forget to set signed flag
    data.signed(true);
    // change the content protection keys to 2
    data.publicKey(keyPair2.getPublic());
    // create meta data
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.