FileDocCategorySizeDatePackage
MessageImprint.javaAPI DocAndroid 1.5 API2069Wed May 06 22:41:06 BST 2009org.bouncycastle.asn1.tsp

MessageImprint

public class MessageImprint extends org.bouncycastle.asn1.ASN1Encodable

Fields Summary
org.bouncycastle.asn1.x509.AlgorithmIdentifier
hashAlgorithm
byte[]
hashedMessage
Constructors Summary
public MessageImprint(org.bouncycastle.asn1.ASN1Sequence seq)

        this.hashAlgorithm = AlgorithmIdentifier.getInstance(seq.getObjectAt(0));
        this.hashedMessage = ASN1OctetString.getInstance(seq.getObjectAt(1)).getOctets();
    
public MessageImprint(org.bouncycastle.asn1.x509.AlgorithmIdentifier hashAlgorithm, byte[] hashedMessage)

        this.hashAlgorithm = hashAlgorithm;
        this.hashedMessage = hashedMessage;
    
Methods Summary
public org.bouncycastle.asn1.x509.AlgorithmIdentifiergetHashAlgorithm()

        return hashAlgorithm;
    
public byte[]getHashedMessage()

        return hashedMessage;
    
public static org.bouncycastle.asn1.tsp.MessageImprintgetInstance(java.lang.Object o)

param
o
return
a MessageImprint object.

        if (o == null || o instanceof MessageImprint)
        {
            return (MessageImprint)o;
        }
        else if (o instanceof ASN1Sequence)
        {
            return new MessageImprint((ASN1Sequence)o);
        }
        
        throw new IllegalArgumentException("Bad object in factory.");
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()
MessageImprint ::= SEQUENCE {
hashAlgorithm AlgorithmIdentifier,
hashedMessage OCTET STRING }

        ASN1EncodableVector  v = new ASN1EncodableVector();

        v.add(hashAlgorithm);
        v.add(new DEROctetString(hashedMessage));

        return new DERSequence(v);