Skip navigation links

Oracle Fusion Middleware Crypto FIPS Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10696-05


oracle.security.crypto.core
Class DigestInfo

java.lang.Object
  extended by oracle.security.crypto.core.DigestInfo

All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, ASN1Object, Streamable

public final class DigestInfo
extends java.lang.Object
implements ASN1Object, java.io.Externalizable

The DigestInfo structure of PKCS #1 and CMS.

See Also:
Serialized Form

Constructor Summary
DigestInfo()
          Creates a new empty instance.
DigestInfo(AlgorithmIdentifier digestAlgID, byte[] digest)
          Creates a new instance with the specified parameters.
DigestInfo(java.io.InputStream is)
          Creates a new DigestInfo object from the specified stream.

 

Method Summary
 boolean equals(AlgorithmIdentifier digestAlgID, byte[] digest)
          Tests if the algorithm identifier and the digest value of this DigestInfo object are identical to the specified parameters.
 boolean equals(java.lang.Object o)
          Compares this DigestInfo object to the specified parameter.
 byte[] getDigest()
          Returns the digest value.
 AlgorithmIdentifier getDigestAlgID()
          Returns the hash algorithm of this digest info object.
 void input(java.io.InputStream is)
          Inputs this object from the specified input stream.
 int length()
          Length of this object's encoding.
 void output(java.io.OutputStream os)
          Outputs this object to the specified output stream.
 void readExternal(java.io.ObjectInput is)
          Reads the input stream and initializes the digest info.
 java.lang.String toString()
          Returns a description of this DigestInfo instance.
 void writeExternal(java.io.ObjectOutput os)
          Writes to the output stream the DER encoding of this object.

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

DigestInfo

public DigestInfo()
Creates a new empty instance. This constructor is to be used with serialization or with the input method.

DigestInfo

public DigestInfo(AlgorithmIdentifier digestAlgID,
                  byte[] digest)
Creates a new instance with the specified parameters.
Parameters:
digestAlgID - The hash algorithm identifier corresponding to the digest.
digest - The digest value.

DigestInfo

public DigestInfo(java.io.InputStream is)
           throws java.io.IOException
Creates a new DigestInfo object from the specified stream.
Parameters:
is - The stream to read the data from.
Throws:
java.io.IOException

Method Detail

getDigestAlgID

public AlgorithmIdentifier getDigestAlgID()
Returns the hash algorithm of this digest info object.
Returns:
An AlgorithIdentifier object representing the hash algorithm identifier corresponding to the digest value.

getDigest

public byte[] getDigest()
Returns the digest value.
Returns:
A byte array containing the digest value.

equals

public boolean equals(AlgorithmIdentifier digestAlgID,
                      byte[] digest)
Tests if the algorithm identifier and the digest value of this DigestInfo object are identical to the specified parameters.
Parameters:
digestAlgID - The AlgorithmIdentifier to compare with the AlgorithmIdentifier of this DigestInfo.
digest - The digest value to compare with the digest value of this DigestInfo instance.
Returns:
true if the algoritm identifiers and the digest values are identical, false otherwise.

equals

public boolean equals(java.lang.Object o)
Compares this DigestInfo object to the specified parameter.
Overrides:
equals in class java.lang.Object
Returns:
true if the two objects are identical, false otherwise.

toString

public java.lang.String toString()
Returns a description of this DigestInfo instance.
Overrides:
toString in class java.lang.Object

input

public void input(java.io.InputStream is)
           throws java.io.IOException
Description copied from interface: Streamable
Inputs this object from the specified input stream.
Specified by:
input in interface Streamable
Throws:
java.io.IOException

output

public void output(java.io.OutputStream os)
            throws java.io.IOException
Description copied from interface: Streamable
Outputs this object to the specified output stream.
Specified by:
output in interface Streamable
Throws:
java.io.IOException

length

public int length()
Description copied from interface: Streamable
Length of this object's encoding.
Specified by:
length in interface Streamable

writeExternal

public void writeExternal(java.io.ObjectOutput os)
                   throws java.io.IOException
Writes to the output stream the DER encoding of this object.
Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
os - The output stream to write the encoding to.
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput is)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Reads the input stream and initializes the digest info.
Specified by:
readExternal in interface java.io.Externalizable
Parameters:
is - The stream to read from.
Throws:
java.io.IOException
java.lang.ClassNotFoundException

Skip navigation links

Oracle Fusion Middleware Crypto FIPS Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10696-05


Copyright © 2005, 2013, Oracle. All rights reserved.