All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----cryptix.security.MessageDigest
This is the abstract superclass for message digests that support the Cryptix V2.2 API. New code should use java.security.MessageDigest in preference.
Note: the following methods are no longer supported (starting from Cryptix 2.2.2), because they either have no JCE equivalent, or were part of the implementation of MessageDigest and should not have been public.
public long bitcount();
public int data_length();
public byte[] buf();
public int buf_off();
Copyright © 1995-1997
Systemics Ltd on behalf of the
Cryptix Development Team.
All rights reserved.
$Revision: 1.2 $
hash_length.
Deprecated.
protected MessageDigest(MessageDigest md)
public final int hash_length()
getDigestLength() instead.
The JCA equivalent to this method,
java.security.MessageDigest.getDigestLength, is only supported
when the IJCE version of the java.security.MessageDigest class
is first on the classpath. getDigestLength will also be
supported by Java 1.2.
public final int length()
getDigestLength() instead.
hash_length.
public final String name()
getAlgorithm() instead.
public final MessageHash digestAsHash()
md.digestAsHash() with
MessageHash.fromDigest(md).
N.B. this method resets the digest.
public final void add(String message,
int offset,
int length)
update(cryptix.mime.LegacyString.toByteArray(message,
offset, length)) instead.
\u00FF gracefully.
public final void add(String message)
update(cryptix.mime.LegacyString.toByteArray(message)) instead.
\u00FF gracefully.
public final void add(byte data[])
update(data) instead.
public final void add(byte data[],
int offset,
int length)
update(data, offset, length).
public final byte[] digest(byte data[])
public final byte[] digest()
public final void reset()
public static byte[] hash(String message,
MessageDigest md)
\u00FF gracefully.
E.g.:
import cryptix.security.MessageDigest;which should be replaced with:
byte[] key = MessageDigest.hash(passphrase, new SHA());
import java.security.MessageDigest; import cryptix.mime.LegacyString;or (better for new applications, but not completely compatible):
MessageDigest sha = MessageDigest.getInstance("SHA-1"); byte[] key = sha.digest(LegacyString.toByteArray(passphrase));
...
byte[] key = sha.digest(passphrase.getBytes("UTF8"));
public static byte[] hash(byte data[],
MessageDigest md)
md.digest(data) instead.
E.g.:
import cryptix.security.MessageDigest;which should be replaced with
byte[] key = MessageDigest.hash(bytearray, new SHA());
import java.security.MessageDigest;
MessageDigest sha = MessageDigest.getInstance("SHA-1"); byte[] key = sha.digest(bytearray);
All Packages Class Hierarchy This Package Previous Next Index