FileDocCategorySizeDatePackage
DigestInfo.javaAPI DocAzureus 3.0.3.42061Tue Jun 08 05:12:56 BST 2004org.bouncycastle.asn1.x509

DigestInfo

public class DigestInfo extends Object implements org.bouncycastle.asn1.DEREncodable
The DigestInfo object.
DigestInfo::=SEQUENCE{
digestAlgorithm AlgorithmIdentifier,
digest OCTET STRING }

Fields Summary
private byte[]
digest
private AlgorithmIdentifier
algId
Constructors Summary
public DigestInfo(AlgorithmIdentifier algId, byte[] digest)

        this.digest = digest;
        this.algId = algId;
    
public DigestInfo(org.bouncycastle.asn1.ASN1Sequence obj)

        Enumeration             e = obj.getObjects();

        algId = AlgorithmIdentifier.getInstance(e.nextElement());
        digest = ((ASN1OctetString)e.nextElement()).getOctets();
    
Methods Summary
public AlgorithmIdentifiergetAlgorithmId()

        return algId;
    
public org.bouncycastle.asn1.DERObjectgetDERObject()

        ASN1EncodableVector  v = new ASN1EncodableVector();

        v.add(algId);
        v.add(new DEROctetString(digest));

        return new DERSequence(v);
    
public byte[]getDigest()

        return digest;
    
public static org.bouncycastle.asn1.x509.DigestInfogetInstance(org.bouncycastle.asn1.ASN1TaggedObject obj, boolean explicit)

        return getInstance(ASN1Sequence.getInstance(obj, explicit));
    
public static org.bouncycastle.asn1.x509.DigestInfogetInstance(java.lang.Object obj)

        if (obj instanceof DigestInfo)
        {
            return (DigestInfo)obj;
        }
        else if (obj instanceof ASN1Sequence)
        {
            return new DigestInfo((ASN1Sequence)obj);
        }

        throw new IllegalArgumentException("unknown object in factory");