FileDocCategorySizeDatePackage
OriginatorInfo.javaAPI DocAndroid 1.5 API3598Wed May 06 22:41:06 BST 2009org.bouncycastle.asn1.cms

OriginatorInfo

public class OriginatorInfo extends org.bouncycastle.asn1.ASN1Encodable

Fields Summary
private org.bouncycastle.asn1.ASN1Set
certs
private org.bouncycastle.asn1.ASN1Set
crls
Constructors Summary
public OriginatorInfo(org.bouncycastle.asn1.ASN1Set certs, org.bouncycastle.asn1.ASN1Set crls)

        this.certs = certs;
        this.crls = crls;
    
public OriginatorInfo(org.bouncycastle.asn1.ASN1Sequence seq)

        switch (seq.size())
        {
        case 0:     // empty
            break;
        case 1:
            ASN1TaggedObject o = (ASN1TaggedObject)seq.getObjectAt(0);
            switch (o.getTagNo())
            {
            case 0 :
                certs = ASN1Set.getInstance(o, false);
                break;
            case 1 :
                crls = ASN1Set.getInstance(o, false);
                break;
            default:
                throw new IllegalArgumentException("Bad tag in OriginatorInfo: " + o.getTagNo());
            }
            break;
        case 2:
            certs = ASN1Set.getInstance((ASN1TaggedObject)seq.getObjectAt(0), false);
            crls  = ASN1Set.getInstance((ASN1TaggedObject)seq.getObjectAt(1), false);
            break;
        default:
            throw new IllegalArgumentException("OriginatorInfo too big");
        }
    
Methods Summary
public org.bouncycastle.asn1.ASN1SetgetCRLs()

        return crls;
    
public org.bouncycastle.asn1.ASN1SetgetCertificates()

        return certs;
    
public static org.bouncycastle.asn1.cms.OriginatorInfogetInstance(org.bouncycastle.asn1.ASN1TaggedObject obj, boolean explicit)
return an OriginatorInfo object from a tagged object.

param
obj the tagged object holding the object we want.
param
explicit true if the object is meant to be explicitly tagged false otherwise.
exception
IllegalArgumentException if the object held by the tagged object cannot be converted.

        return getInstance(ASN1Sequence.getInstance(obj, explicit));
    
public static org.bouncycastle.asn1.cms.OriginatorInfogetInstance(java.lang.Object obj)
return an OriginatorInfo object from the given object.

param
obj the object we want converted.
exception
IllegalArgumentException if the object cannot be converted.

        if (obj == null || obj instanceof OriginatorInfo)
        {
            return (OriginatorInfo)obj;
        }
        
        if (obj instanceof ASN1Sequence)
        {
            return new OriginatorInfo((ASN1Sequence)obj);
        }
        
        throw new IllegalArgumentException("Invalid OriginatorInfo: " + obj.getClass().getName());
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()
Produce an object suitable for an ASN1OutputStream.
OriginatorInfo ::= SEQUENCE {
certs [0] IMPLICIT CertificateSet OPTIONAL,
crls [1] IMPLICIT CertificateRevocationLists OPTIONAL
}

        ASN1EncodableVector  v = new ASN1EncodableVector();

        if (certs != null)
        {
            v.add(new DERTaggedObject(false, 0, certs));
        }
        
        if (crls != null)
        {
            v.add(new DERTaggedObject(false, 1, crls));
        }
        
        return new DERSequence(v);