JXTA

net.jxta.impl.util
Class JxtaHash

java.lang.Object
  extended by net.jxta.impl.util.JxtaHash

public class JxtaHash
extends Object

A message digest wrapper to provide hashing using java.security.MesssageDigest


Field Summary
static String DSA
           
static String MD2
           
static String MD5
           
static String RSA
           
static String SHA
           
static String SHA1
           
static String SHA1withDSA
           
 
Constructor Summary
JxtaHash()
          Default JxtaHash constructor, with the default algorithm SHA1
JxtaHash(String expression)
          Default JxtaHash constructor, with the default algorithm SHA1
JxtaHash(String algorithm, byte[] expression)
          Constructor for the JxtaHash object
JxtaHash(String algorithm, String expression)
          Deprecated. This implementation may produce inconsistent results based upon varience of the locale. (The locale of getBytes() is not defined).
 
Method Summary
 BigInteger getDigestInteger()
          Gets the digest as digestInteger
 BigInteger getDigestInteger(byte[] expression)
          Gets the digest as digestInteger
 BigInteger getDigestInteger(String expression)
          Gets the digest as digestInteger
 int mod(long m)
          Returns a int whose value is (getDigestInteger mod m).
 void update(String expression)
          Constructor for the JxtaHash object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHA

public static final String SHA
See Also:
Constant Field Values

SHA1

public static final String SHA1
See Also:
Constant Field Values

MD2

public static final String MD2
See Also:
Constant Field Values

MD5

public static final String MD5
See Also:
Constant Field Values

DSA

public static final String DSA
See Also:
Constant Field Values

RSA

public static final String RSA
See Also:
Constant Field Values

SHA1withDSA

public static final String SHA1withDSA
See Also:
Constant Field Values
Constructor Detail

JxtaHash

public JxtaHash()
Default JxtaHash constructor, with the default algorithm SHA1


JxtaHash

public JxtaHash(String expression)
Default JxtaHash constructor, with the default algorithm SHA1

Parameters:
expression - message to hash

JxtaHash

@Deprecated
public JxtaHash(String algorithm,
                           String expression)
Deprecated. This implementation may produce inconsistent results based upon varience of the locale. (The locale of getBytes() is not defined).

Constructor for the JxtaHash object

Parameters:
algorithm - algorithm - the name of the algorithm requested
expression - expression to digest

JxtaHash

public JxtaHash(String algorithm,
                byte[] expression)
Constructor for the JxtaHash object

Parameters:
algorithm - algorithm - the name of the algorithm requested
expression - expression to digest
Method Detail

update

public void update(String expression)
Constructor for the JxtaHash object

Parameters:
expression - expression to digest

getDigestInteger

public BigInteger getDigestInteger()
Gets the digest as digestInteger

Returns:
The digestInteger value

getDigestInteger

public BigInteger getDigestInteger(byte[] expression)
Gets the digest as digestInteger

Parameters:
expression - expression to digest
Returns:
The digestInteger value

getDigestInteger

public BigInteger getDigestInteger(String expression)
Gets the digest as digestInteger

Parameters:
expression - expression to digest
Returns:
The digestInteger value

mod

public int mod(long m)
Returns a int whose value is (getDigestInteger mod m).

Parameters:
m - the modulus.
Returns:
(getDigestInteger mod m).

JXSE