FileDocCategorySizeDatePackage
ContentInfo.javaAPI DocAzureus 3.0.3.42151Tue Jun 08 05:12:58 BST 2004org.bouncycastle.asn1.pkcs

ContentInfo

public class ContentInfo extends Object implements org.bouncycastle.asn1.DEREncodable, PKCSObjectIdentifiers

Fields Summary
private org.bouncycastle.asn1.DERObjectIdentifier
contentType
private org.bouncycastle.asn1.DEREncodable
content
Constructors Summary
public ContentInfo(org.bouncycastle.asn1.ASN1Sequence seq)

        Enumeration   e = seq.getObjects();

        contentType = (DERObjectIdentifier)e.nextElement();

        if (e.hasMoreElements())
        {
            content = ((DERTaggedObject)e.nextElement()).getObject();
        }
    
public ContentInfo(org.bouncycastle.asn1.DERObjectIdentifier contentType, org.bouncycastle.asn1.DEREncodable content)

        this.contentType = contentType;
        this.content = content;
    
Methods Summary
public org.bouncycastle.asn1.DEREncodablegetContent()

        return content;
    
public org.bouncycastle.asn1.DERObjectIdentifiergetContentType()

        return contentType;
    
public org.bouncycastle.asn1.DERObjectgetDERObject()
Produce an object suitable for an ASN1OutputStream.
ContentInfo ::= SEQUENCE {
contentType ContentType,
content
[0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }

        ASN1EncodableVector  v = new ASN1EncodableVector();

        v.add(contentType);

        if (content != null)
        {
            v.add(new BERTaggedObject(0, content));
        }

        return new BERSequence(v);
    
public static org.bouncycastle.asn1.pkcs.ContentInfogetInstance(java.lang.Object obj)

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

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