Examples of digest()


Examples of gnu.java.security.hash.Sha160.digest()

    harness.check(bob.verify(signature), "instance methods");

    IMessageDigest sha = new Sha160();
    sha.update(message, 0, message.length);
    byte[] hash = sha.digest();
    BigInteger[] rs = DSSSignature.sign(privateK, hash);

    harness.check(DSSSignature.verify(publicK, hash, rs), "class methods");
  }
}
View Full Code Here

Examples of gnu.javax.crypto.mac.IMac.digest()

        clone.update((byte) 'a');
        clone.update((byte) 'b');
        clone.update((byte) 'c');

        byte[] md1 = hmac.digest();
        byte[] md2 = clone.digest();

        harness.check(Arrays.equals(md1, md2), "clone1");
      }
    catch (Exception x)
      {
View Full Code Here

Examples of gnu.javax.crypto.mode.IAuthenticatedMode.digest()

            byte[] ct = new byte[TESTS[i][2].length];
            for (int j = 0; j < TESTS[i][2].length; j += mode.currentBlockSize())
              {
                mode.update(TESTS[i][2], j, ct, j);
              }
            byte[] tag = mode.digest();
            harness.verbose(" KEY: " + Util.toString(TESTS[i][0]));
            harness.verbose("  IV: " + Util.toString(TESTS[i][1]));
            harness.verbose(" MSG: " + Util.toString(TESTS[i][2]));
            harness.verbose(" HDR: " + Util.toString(TESTS[i][3]));
            harness.verbose(" ECT: " + Util.toString(TESTS[i][4]));
View Full Code Here

Examples of hudson.FilePath.digest()

        }

        boolean view = rest.equals("*view*");

        if(rest.equals("*fingerprint*")) {
            rsp.forward(Jenkins.getInstance().getFingerprint(baseFile.digest()),"/",req);
            return;
        }

        ContentInfo ci = baseFile.act(new ContentInfo());

View Full Code Here

Examples of io.fathom.cloud.storage.ResumableMD5Digest.digest()

            }
            md5.update(blob.data);
        }

        ByteString hashResume = md5.getState();
        ByteString hash = ByteString.copyFrom(md5.digest());

        file.setHash(hash);

        // NOTE: hashResume can contain plaintext. Careful around encryption!
        file.setHashResume(hashResume);
View Full Code Here

Examples of java.security.MessageDigest.digest()

        MessageDigest digest=MessageDigest.getInstance("MD5");
        digest.reset();
        digest.update(server.getDesKey().getEncoded());

        String symVersion=new String(digest.digest(), "UTF-8");

        // encrypt and send an initial message to peer
        Cipher cipher=server.getSymEncodingCipher();
        Message msg=new Message();
        msg.setBuffer(cipher.doFinal("hello".getBytes()));
View Full Code Here

Examples of java.security.MessageDigest.digest()

     * @return the MD5 hashed version of the string
     */
    public static String md5(String source) {
        try {
            MessageDigest md = MessageDigest.getInstance("MD5");
            byte[] bytes = md.digest(source.getBytes());
            return getString(bytes);
        } catch (Exception e) {
            return null;
        }
    }
View Full Code Here

Examples of java.security.MessageDigest.digest()

     * @return the MD5 hashed version of the string
     */
    public static String sha(String source) {
        try {
            MessageDigest md = MessageDigest.getInstance("SHA");
            byte[] bytes = md.digest(source.getBytes());
            return getString(bytes);
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
View Full Code Here

Examples of java.security.MessageDigest.digest()

        MessageDigest digest=MessageDigest.getInstance("MD5");
        digest.reset();
        digest.update(encrypt.getDesKey().getEncoded());

        String symVersion=new String(digest.digest(), "UTF-8");

        Message msg=new Message(null, null, encodedBytes);
        msg.putHeader(ENCRYPT_ID, new ENCRYPT.EncryptHeader(ENCRYPT.EncryptHeader.ENCRYPT, symVersion));
        Event event=new Event(Event.MSG, msg);
        encrypt.up(event);
View Full Code Here

Examples of java.security.MessageDigest.digest()

        MessageDigest digest=MessageDigest.getInstance("MD5");
        digest.reset();
        digest.update(encrypt2.getDesKey().getEncoded());

        String symVersion=new String(digest.digest());

        Message msg=new Message(null, null, encodedBytes);
        msg.putHeader(ENCRYPT_ID, new ENCRYPT.EncryptHeader(ENCRYPT.EncryptHeader.ENCRYPT, symVersion));
        Event event=new Event(Event.MSG, msg);
        encrypt.up(event);
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.