messagedigestmessagedigest
Direct Known Subclasses:
public abstract class MessageDigest
The MessageDigest class is the base class for hashing algorithms. Implementations of MessageDigest algorithms must extend this class and implement all the abstract methods.
A tear or card reset event resets a MessageDigest object to the initial state (state upon construction).
Even if a transaction is in progress, update of intermediate result state in the implementation instance shall not participate in the transaction.
Field Summary
Constructor Summary
Method Summary
(byte[]inBuff,shortinOffset,shortinLength,byte[]outBuff,shortoutOffset)
Generates a hash of all/last input data.
Methods inherited from class java.lang.Object
Field Detail
ALG_SHA
public static final byte ALG_SHA
Message Digest algorithm SHA. The block size used by this algorithm is 64 bytes.
See Also:
ALG_MD5
public static final byte ALG_MD5Message Digest algorithm MD5. The block size used by this algorithm is 64 bytes.
See Also:
ALG_RIPEMD160
public static final byte ALG_RIPEMD160Message Digest algorithm RIPE MD-160. The block size used by this algorithm is 64 bytes.
See Also:
ALG_SHA_256
public static final byte ALG_SHA_256Message Digest algorithm SHA-256. The block size used by this algorithm is 64 bytes.
See Also:
ALG_SHA_384
public static final byte ALG_SHA_384Message Digest algorithm SHA-384. The block size used by this algorithm is 128 bytes.
See Also:
ALG_SHA_512
public static final byte ALG_SHA_512Message Digest algorithm SHA-512. The block size used by this algorithm is 128 bytes.
See Also:
LENGTH_MD5
public static final byte LENGTH_MD5Length of digest in bytes for SHA
See Also:
LENGTH_RIPEMD160
public static final byte LENGTH_RIPEMD160Length of digest in bytes for RIPE MD-160
See Also:
LENGTH_SHA
public static final byte LENGTH_SHALength of digest in bytes for SHA-256
See Also:
LENGTH_SHA_256
public static final byte LENGTH_SHA_256Length of digest in bytes for MD5
See Also:
LENGTH_SHA_384
public static final byte LENGTH_SHA_384Length of digest in bytes for SHA-384
See Also:
LENGTH_SHA_512
public static final byte LENGTH_SHA_512Length of digest in bytes for SHA-512
See Also:
Constructor Detail
MessageDigest
protected MessageDigest()Protected Constructor
Method Detail
getInstance
public static final MessageDigest getInstance(byte algorithm, boolean externalAccess) throws CryptoExceptionCreates a MessageDigest object instance of the selected algorithm.
Parameters:algorithm - the desired message digest algorithm. Valid codes listed in ALG_* constants above, for example, .externalAccess - true indicates that the instance will be shared among multiple applet instances and that the MessageDigest instance will also be accessed (via a Shareable. intece) when the owner of the MessageDigest instance is not the currently selected applet. If true the implementation must not allocate CLEAR_ON_DESELECT transient space for internal data.Returns:the MessageDigest object instance of the requested algorithmThrows:CryptoException - with the following reason codes:
CryptoException.NO_SUCH_ALGORITHM if the requested algorithm or shared access mode is not supported.
getInitializedMessageDigestInstance
public static final InitializedMessageDigest getInitializedMessageDigestInstance(byte algorithm, boolean externalAccess) throws CryptoException
Creates a InitializedMessageDigest object instance of the selected algorithm.
Parameters:algorithm - the desired message digest algorithm. Valid codes listed in ALG_* constants above, for example, .externalAccess - true indicates that the instance will be shared among multiple applet instances and that the InitializedMessageDigest instance will also be accessed (via a Shareable. intece) when the owner of the InitializedMessageDigest instance is not the currently selected applet. If true the implementation must not allocate CLEAR_ON_DESELECT transient space for internal data.Returns:the InitializedMessageDigest object instance of the requested algorithmThrows:CryptoException - with the following reason codes:
CryptoException.NO_SUCH_ALGORITHM if the requested algorithm or shared access mode is not supported.Since:
本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/tongxinshuyu/article-38603-1.html
很真实