edu.berkeley.psi.tagged.api
Class SHA256Digest

java.lang.Object
  extended by edu.berkeley.psi.tagged.api.Tagged
      extended by edu.berkeley.psi.tagged.api.Digest
          extended by edu.berkeley.psi.tagged.api.SHA256Digest
All Implemented Interfaces:
TaggedIF, XdrAble

public class SHA256Digest
extends Digest

Represents a SHA-256 hash digest result. It will normally be XDR-serialized as a 4-byte tag followed by a 32-byte hash value.


Field Summary
protected static int SHA256_LENGTH
           
 
Fields inherited from class edu.berkeley.psi.tagged.api.Digest
data, DEFAULT_ALGORITHM, DEFAULT_ALGORITHM_ID, MD2, MD5, SHA1, SHA256, SHA384, SHA512
 
Fields inherited from class edu.berkeley.psi.tagged.api.Tagged
classes, initLock
 
Constructor Summary
SHA256Digest(byte[] data)
           
 
Method Summary
 java.lang.String getAlgorithm()
           
 int getAlgorithmId()
           
(package private) static Digest newInstance()
           
static Digest newInstance(byte[] data)
           
static int staticTag()
           
 void xdrDecode(XdrDecodingStream xdr)
          Decodes -- that is: deserializes -- an object from a XDR stream in compliance to RFC 1832.
 void xdrEncode(XdrEncodingStream xdr)
          Encodes -- that is: serializes -- an object into a XDR stream in compliance to RFC 1832.
 
Methods inherited from class edu.berkeley.psi.tagged.api.Digest
bytes, factory, getAlgorithm, getAlgorithmId, getDigestLength
 
Methods inherited from class edu.berkeley.psi.tagged.api.Tagged
addClass, addClass, digest, digest, digestWith, get, getBody, getTag, newInstance, put, put, putBody, putTag
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHA256_LENGTH

protected static final int SHA256_LENGTH
See Also:
Constant Field Values
Constructor Detail

SHA256Digest

SHA256Digest(byte[] data)
Method Detail

getAlgorithm

public java.lang.String getAlgorithm()
Specified by:
getAlgorithm in class Digest

staticTag

public static int staticTag()

getAlgorithmId

public int getAlgorithmId()
Specified by:
getAlgorithmId in class Digest

newInstance

public static Digest newInstance(byte[] data)

xdrDecode

public void xdrDecode(XdrDecodingStream xdr)
               throws OncRpcException,
                      java.io.IOException
Description copied from interface: XdrAble
Decodes -- that is: deserializes -- an object from a XDR stream in compliance to RFC 1832.

Parameters:
xdr - XDR stream from which decoded information is retrieved.
Throws:
OncRpcException - if an ONC/RPC error occurs.
java.io.IOException - if an I/O error occurs.

xdrEncode

public void xdrEncode(XdrEncodingStream xdr)
               throws OncRpcException,
                      java.io.IOException
Description copied from interface: XdrAble
Encodes -- that is: serializes -- an object into a XDR stream in compliance to RFC 1832.

Parameters:
xdr - XDR stream to which information is sent for encoding.
Throws:
OncRpcException - if an ONC/RPC error occurs.
java.io.IOException - if an I/O error occurs.

newInstance

static Digest newInstance()