|
Java Card 2.1 Platform Final Revision 1.0 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object | +--javacard.security.MessageDigest
The MessageDigest class is the base class for hashing algorthims. Implementations of MessageDigest
algorithms must extend this class and implement all the abstract methods.
| Field Summary | |
static byte |
ALG_MD5
Message Digest algorithm MD5. |
static byte |
ALG_RIPEMD160
Message Digest algorithm RIPE MD-160. |
static byte |
ALG_SHA
Message Digest algorithm SHA. |
| Constructor Summary | |
protected |
MessageDigest()
Protected Constructor |
| Method Summary | |
abstract short |
doFinal(byte[] inBuff,
short inOffset,
short inLength,
byte[] outBuff,
short outOffset)
Generates a hash of all/last input data. |
abstract byte |
getAlgorithm()
Gets the Message digest algorithm. |
static MessageDigest |
getInstance(byte algorithm,
boolean externalAccess)
Creates a MessageDigest object instance of the selected algorithm. |
abstract byte |
getLength()
Returns the byte length of the hash. |
abstract void |
update(byte[] inBuff,
short inOffset,
short inLength)
Accumulates a hash of the input data. |
| Methods inherited from class java.lang.Object |
equals |
| Field Detail |
public static final byte ALG_SHA
public static final byte ALG_MD5
public static final byte ALG_RIPEMD160
| Constructor Detail |
protected MessageDigest()
| Method Detail |
public static final MessageDigest getInstance(byte algorithm,
boolean externalAccess)
throws CryptoException
MessageDigest object instance of the selected algorithm.algorithm - the desired message digest algorithm. Valid codes listed in ALG_.. constants. See above.externalAccess - if true indicates that the instance will be shared among
multiple applet instances and that the MessageDigest instance will also be accessed (via a Shareable
interface) when the owner of the MessageDigest instance is not the currently selected applet.MessageDigest object instance of the requested algorithm.CryptoException.NO_SUCH_ALGORITHM if the requested algorithm is not supported.public abstract byte getAlgorithm()
public abstract byte getLength()
public abstract short doFinal(byte[] inBuff,
short inOffset,
short inLength,
byte[] outBuff,
short outOffset)
MessageDigest object is reset after this call is made.
The input and output buffer data may overlap.
inBuff - the input buffer of data to be hashedinOffset - the offset into the input buffer at which to begin hash generationinLength - the byte length to hashoutBuff - the output buffer, may be the same as the input bufferoutOffset - the offset into the output buffer where the resulting hash value beginsoutBuff
public abstract void update(byte[] inBuff,
short inOffset,
short inLength)
inBuff - the input buffer of data to be hashedinOffset - the offset into the input buffer at which to begin hash generationinLength - the byte length to hashdoFinal(byte[], short, short, byte[], short)
|
Submit a bug or feature Java and Java Card are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 1993-1999 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved. |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||