de.flexiprovider.core.md
Class SHA1

java.lang.Object
  |
  +--java.security.MessageDigestSpi
        |
        +--de.flexiprovider.api.MessageDigest
              |
              +--de.flexiprovider.core.md.SHA1

public final class SHA1
extends MessageDigest

SHA1 extends java.security.MessageDigestSpi A class that implements the NIST Secure Hash Algorithm - version 1. The Algorithm was implemented according to Standard FIPS PUB 180-1.

Author:
Torsten Ehli, Sylvain Franke, Ralf-Philipp Weinmann

Field Summary
static java.lang.String ALG_NAME
          The algorithm name.
static java.lang.String ALG_NAME2
          An alternative algorithm name.
static java.lang.String OID
          The OID of SHA1 (defined by IEEE P1363).
 
Constructor Summary
SHA1()
          Constructor.
 
Method Summary
 byte[] digest()
          Completes the hash computation by performing final operations such as padding.
 int getDigestLength()
          Returns the digest length in bytes.
 void reset()
          Resets the digest for further use.
 void update(byte input)
          Updates the digest using the specified byte.
 void update(byte[] input, int offset, int len)
          Updates the digest using the specified array of bytes, starting at the specified offset.
 
Methods inherited from class de.flexiprovider.api.MessageDigest
digest, digest, engineDigest, engineGetDigestLength, engineReset, engineUpdate, engineUpdate, update
 
Methods inherited from class java.security.MessageDigestSpi
clone, engineDigest
 
Methods inherited from class java.lang.Object
, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALG_NAME

public static final java.lang.String ALG_NAME
The algorithm name.

ALG_NAME2

public static final java.lang.String ALG_NAME2
An alternative algorithm name.

OID

public static final java.lang.String OID
The OID of SHA1 (defined by IEEE P1363).
Constructor Detail

SHA1

public SHA1()
Constructor. Create and initialize the arrays needed for computing the digest.
Method Detail

digest

public byte[] digest()
Completes the hash computation by performing final operations such as padding.
Overrides:
digest in class MessageDigest
Returns:
the digest value

getDigestLength

public int getDigestLength()
Returns the digest length in bytes.
Overrides:
getDigestLength in class MessageDigest
Returns:
the digest length in bytes.

reset

public void reset()
Resets the digest for further use.
Overrides:
reset in class MessageDigest

update

public void update(byte[] input,
                   int offset,
                   int len)
Updates the digest using the specified array of bytes, starting at the specified offset.
Overrides:
update in class MessageDigest
Parameters:
input - - the byte[] to use for the update.
offset - - the offset to start from in the array of bytes.
len - - the number of bytes to use, starting at offset.

update

public void update(byte input)
Updates the digest using the specified byte.
Overrides:
update in class MessageDigest
Parameters:
input - - the byte to use for the update.