Examples of MessageDigest


Examples of java.security.MessageDigest

                constraints);
            constraints.insets = valueInsets;

            try
            {
                MessageDigest md = MessageDigest.getInstance("SHA1");
                md.update(certificate.getEncoded());
                String sha1String = getHex(md.digest());

                md = MessageDigest.getInstance("MD5");
                md.update(certificate.getEncoded());
                String md5String = getHex(md.digest());

                JTextArea sha1Area = new JTextArea(sha1String);
                sha1Area.setLineWrap(false);
                sha1Area.setOpaque(false);
                sha1Area.setWrapStyleWord(true);
View Full Code Here

Examples of java.security.MessageDigest

   * @return      HASH结果
   */
  private static byte[] digest(String type, byte[] bytes)
  {
        try {
         MessageDigest dist = MessageDigest.getInstance(type);
        return dist.digest(bytes);
        } catch (NoSuchAlgorithmException e) {
        throw new IllegalArgumentException("Cannot find digest:"+type, e);
        }
  }
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.