FileDocCategorySizeDatePackage
ObjectDigestInfo.javaAPI DocAndroid 1.5 API3374Wed May 06 22:41:06 BST 2009org.bouncycastle.asn1.x509

ObjectDigestInfo

public class ObjectDigestInfo extends org.bouncycastle.asn1.ASN1Encodable

Fields Summary
org.bouncycastle.asn1.DEREnumerated
digestedObjectType
org.bouncycastle.asn1.DERObjectIdentifier
otherObjectTypeID
org.bouncycastle.asn1.x509.AlgorithmIdentifier
digestAlgorithm
org.bouncycastle.asn1.DERBitString
objectDigest
Constructors Summary
public ObjectDigestInfo(org.bouncycastle.asn1.ASN1Sequence seq)

        if (seq.size() > 4 || seq.size() < 3)
        {
            throw new IllegalArgumentException("Bad sequence size: "
                    + seq.size());
        }

        digestedObjectType = DEREnumerated.getInstance(seq.getObjectAt(0));

        int offset = 0;

        if (seq.size() == 4)
        {
            otherObjectTypeID = DERObjectIdentifier.getInstance(seq.getObjectAt(1));
            offset++;
        }

        digestAlgorithm = AlgorithmIdentifier.getInstance(seq.getObjectAt(1 + offset));

        objectDigest = DERBitString.getInstance(seq.getObjectAt(2 + offset));
    
Methods Summary
public org.bouncycastle.asn1.x509.AlgorithmIdentifiergetDigestAlgorithm()

        return digestAlgorithm;
    
public org.bouncycastle.asn1.DEREnumeratedgetDigestedObjectType()

        return digestedObjectType;
    
public static org.bouncycastle.asn1.x509.ObjectDigestInfogetInstance(java.lang.Object obj)

        if (obj == null || obj instanceof ObjectDigestInfo)
        {
            return (ObjectDigestInfo)obj;
        }

        if (obj instanceof ASN1Sequence)
        {
            return new ObjectDigestInfo((ASN1Sequence)obj);
        }

        throw new IllegalArgumentException("illegal object in getInstance: " + obj.getClass().getName());
    
public static org.bouncycastle.asn1.x509.ObjectDigestInfogetInstance(org.bouncycastle.asn1.ASN1TaggedObject obj, boolean explicit)

        return getInstance(ASN1Sequence.getInstance(obj, explicit));
    
public org.bouncycastle.asn1.DERBitStringgetObjectDigest()

        return objectDigest;
    
public org.bouncycastle.asn1.DERObjectIdentifiergetOtherObjectTypeID()

        return otherObjectTypeID;
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()
Produce an object suitable for an ASN1OutputStream.

ObjectDigestInfo ::= SEQUENCE {
digestedObjectType ENUMERATED {
publicKey (0),
publicKeyCert (1),
otherObjectTypes (2) },
-- otherObjectTypes MUST NOT
-- be used in this profile
otherObjectTypeID OBJECT IDENTIFIER OPTIONAL,
digestAlgorithm AlgorithmIdentifier,
objectDigest BIT STRING
}

        ASN1EncodableVector v = new ASN1EncodableVector();

        v.add(digestedObjectType);

        if (otherObjectTypeID != null)
        {
            v.add(otherObjectTypeID);
        }

        v.add(digestAlgorithm);
        v.add(objectDigest);

        return new DERSequence(v);