Class MessageDigest
java.lang.Object
java.security.MessageDigest
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 Summary
Modifier and TypeMethodDescriptionbyte[]digest()The digest of everything given so far; the next one starts empty.byte[]digest(byte[] input) intstatic MessageDigestgetInstance(String algorithm) static booleanisEqual(byte[] a, byte[] b) Whether two digests are the same, in a time that does not depend on where they first differ.voidreset()toString()Returns a string representation of the object.voidupdate(byte input) voidupdate(byte[] input) voidupdate(byte[] input, int offset, int len)
-
Method Details
-
getInstance
- 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
-
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
Description copied from class:ObjectReturns 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())
-