public class MessageImprint
extends java.lang.Object
Constructor and Description |
---|
MessageImprint(AlgorithmIdentifier alg,
byte[] message,
boolean hashMessage)
Constructs a new MessageImprint object initialized with the given paramters.
|
MessageImprint(java.io.InputStream is)
Constructs a MessageImprint object by reading in a DER-encoded MessageImprint
from the given input stream.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Returns
true if this object is "equal to" another object. |
AlgorithmIdentifier |
getHashAlgorithm()
Returns the hashAlgorithm fiels of this object.
|
byte[] |
getHashedMessage()
Returns the hashedMessage field of this object
|
void |
input(java.io.InputStream is)
Initializes this object by reading in a DER-encoded TSAPolicyID object from the
given input stream.
|
int |
length()
Returns the length of the DER encoding of this object in bytes.
|
void |
output(java.io.OutputStream os)
Writes the DER encoding of this object to the given output stream.
|
java.lang.String |
toString()
Returns a string representation ofthis object.
|
public MessageImprint(AlgorithmIdentifier alg, byte[] message, boolean hashMessage) throws java.security.NoSuchAlgorithmException
alg
- The hashing algorithm.message
- Either the data for which a hash is to be created or the hash itself.hashMessage
- If true
, the data passed in the message
parameter will be hashed; if false
, the data passed
in the message
parameter is assumed to be the hash.java.security.NoSuchAlgorithmException
- If the hashing algorithm is not supportedpublic MessageImprint(java.io.InputStream is) throws java.io.IOException
is
- The input stream.java.io.IOException
- If an I/O error occurs.public void output(java.io.OutputStream os) throws java.io.IOException
os
- The output stream.java.io.IOException
- If an I/O error occurs.public void input(java.io.InputStream is) throws java.io.IOException
is
- java.io.IOException
- If an I/O error occurs.public int length()
public AlgorithmIdentifier getHashAlgorithm()
public byte[] getHashedMessage()
public boolean equals(java.lang.Object o)
true
if this object is "equal to" another object.equals
in class java.lang.Object
o
- The other object.public java.lang.String toString()
toString
in class java.lang.Object