FileDocCategorySizeDatePackage
ResponseData.javaAPI DocAndroid 1.5 API4604Wed May 06 22:41:06 BST 2009org.bouncycastle.asn1.ocsp

ResponseData

public class ResponseData extends org.bouncycastle.asn1.ASN1Encodable

Fields Summary
private static final org.bouncycastle.asn1.DERInteger
V1
private boolean
versionPresent
private org.bouncycastle.asn1.DERInteger
version
private ResponderID
responderID
private org.bouncycastle.asn1.DERGeneralizedTime
producedAt
private org.bouncycastle.asn1.ASN1Sequence
responses
private org.bouncycastle.asn1.x509.X509Extensions
responseExtensions
Constructors Summary
public ResponseData(org.bouncycastle.asn1.DERInteger version, ResponderID responderID, org.bouncycastle.asn1.DERGeneralizedTime producedAt, org.bouncycastle.asn1.ASN1Sequence responses, org.bouncycastle.asn1.x509.X509Extensions responseExtensions)


     
                  
                 
          
                
              
    
        this.version = version;
        this.responderID = responderID;
        this.producedAt = producedAt;
        this.responses = responses;
        this.responseExtensions = responseExtensions;
    
public ResponseData(ResponderID responderID, org.bouncycastle.asn1.DERGeneralizedTime producedAt, org.bouncycastle.asn1.ASN1Sequence responses, org.bouncycastle.asn1.x509.X509Extensions responseExtensions)

        this(V1, responderID, producedAt, responses, responseExtensions);
    
public ResponseData(org.bouncycastle.asn1.ASN1Sequence seq)

        int index = 0;

        if (seq.getObjectAt(0) instanceof ASN1TaggedObject)
        {
            ASN1TaggedObject    o = (ASN1TaggedObject)seq.getObjectAt(0);

            if (o.getTagNo() == 0)
            {
                this.versionPresent = true;
                this.version = DERInteger.getInstance(
                                (ASN1TaggedObject)seq.getObjectAt(0), true);
                index++;
            }
            else
            {
                this.version = V1;
            }
        }
        else
        {
            this.version = V1;
        }

        this.responderID = ResponderID.getInstance(seq.getObjectAt(index++));
        this.producedAt = (DERGeneralizedTime)seq.getObjectAt(index++);
        this.responses = (ASN1Sequence)seq.getObjectAt(index++);

        if (seq.size() > index)
        {
            this.responseExtensions = X509Extensions.getInstance(
                                (ASN1TaggedObject)seq.getObjectAt(index), true);
        }
    
Methods Summary
public static org.bouncycastle.asn1.ocsp.ResponseDatagetInstance(org.bouncycastle.asn1.ASN1TaggedObject obj, boolean explicit)

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

        if (obj == null || obj instanceof ResponseData)
        {
            return (ResponseData)obj;
        }
        else if (obj instanceof ASN1Sequence)
        {
            return new ResponseData((ASN1Sequence)obj);
        }

        throw new IllegalArgumentException("unknown object in factory");
    
public org.bouncycastle.asn1.DERGeneralizedTimegetProducedAt()

        return producedAt;
    
public ResponderIDgetResponderID()

        return responderID;
    
public org.bouncycastle.asn1.x509.X509ExtensionsgetResponseExtensions()

        return responseExtensions;
    
public org.bouncycastle.asn1.ASN1SequencegetResponses()

        return responses;
    
public org.bouncycastle.asn1.DERIntegergetVersion()

        return version;
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()
Produce an object suitable for an ASN1OutputStream.
ResponseData ::= SEQUENCE {
version [0] EXPLICIT Version DEFAULT v1,
responderID ResponderID,
producedAt GeneralizedTime,
responses SEQUENCE OF SingleResponse,
responseExtensions [1] EXPLICIT Extensions OPTIONAL }

        ASN1EncodableVector v = new ASN1EncodableVector();

        if (versionPresent || !version.equals(V1))
        {
            v.add(new DERTaggedObject(true, 0, version));
        }

        v.add(responderID);
        v.add(producedAt);
        v.add(responses);
        if (responseExtensions != null)
        {
            v.add(new DERTaggedObject(true, 1, responseExtensions));
        }

        return new DERSequence(v);