Class MessageDigest

java.lang.Object
java.security.MessageDigest

public final class MessageDigest extends Object

A message digest over the platform's own, which com.codename1.impl.JdkHost reaches: MD5, SHA-1, SHA-224, SHA-256, SHA-384 and SHA-512 in a Codename One application. Any algorithm the platform lacks is a NoSuchAlgorithmException, as it is on a JDK without a provider for it.

There are no providers here: getInstance with a provider argument, getProvider and a subclass of this class are not offered.

  • Method Details

    • getInstance

      public static MessageDigest getInstance(String algorithm) throws NoSuchAlgorithmException
      Throws:
      NoSuchAlgorithmException
    • update

      public void update(byte input)
    • update

      public void update(byte[] input)
    • update

      public void update(byte[] input, int offset, int len)
    • digest

      public byte[] digest()
      The digest of everything given so far; the next one starts empty.
    • digest

      public byte[] digest(byte[] input)
    • reset

      public void reset()
    • getAlgorithm

      public String getAlgorithm()
    • getDigestLength

      public int getDigestLength()
    • isEqual

      public static boolean isEqual(byte[] a, byte[] b)
      Whether two digests are the same, in a time that does not depend on where they first differ.
    • toString

      public String toString()
      Description copied from class: Object
      Returns a string representation of the object. In general, the toString method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method. The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of: getClass().getName() + '@' + Integer.toHexString(hashCode())
      Overrides:
      toString in class Object