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

SingleResponse

public class SingleResponse extends org.bouncycastle.asn1.ASN1Encodable

Fields Summary
private CertID
certID
private CertStatus
certStatus
private org.bouncycastle.asn1.DERGeneralizedTime
thisUpdate
private org.bouncycastle.asn1.DERGeneralizedTime
nextUpdate
private org.bouncycastle.asn1.x509.X509Extensions
singleExtensions
Constructors Summary
public SingleResponse(CertID certID, CertStatus certStatus, org.bouncycastle.asn1.DERGeneralizedTime thisUpdate, org.bouncycastle.asn1.DERGeneralizedTime nextUpdate, org.bouncycastle.asn1.x509.X509Extensions singleExtensions)

        this.certID = certID;
        this.certStatus = certStatus;
        this.thisUpdate = thisUpdate;
        this.nextUpdate = nextUpdate;
        this.singleExtensions = singleExtensions;
    
public SingleResponse(org.bouncycastle.asn1.ASN1Sequence seq)

        this.certID = CertID.getInstance(seq.getObjectAt(0));
        this.certStatus = CertStatus.getInstance(seq.getObjectAt(1));
        this.thisUpdate = (DERGeneralizedTime)seq.getObjectAt(2);

        if (seq.size() > 4)
        {
            this.nextUpdate = DERGeneralizedTime.getInstance(
                                (ASN1TaggedObject)seq.getObjectAt(3), true);
            this.singleExtensions = X509Extensions.getInstance(
                                (ASN1TaggedObject)seq.getObjectAt(4), true);
        }
        else if (seq.size() > 3)
        {
            ASN1TaggedObject    o = (ASN1TaggedObject)seq.getObjectAt(3);

            if (o.getTagNo() == 0)
            {
                this.nextUpdate = DERGeneralizedTime.getInstance(o, true);
            }
            else
            {
                this.singleExtensions = X509Extensions.getInstance(o, true);
            }
        }
    
Methods Summary
public CertIDgetCertID()

        return certID;
    
public CertStatusgetCertStatus()

        return certStatus;
    
public static org.bouncycastle.asn1.ocsp.SingleResponsegetInstance(org.bouncycastle.asn1.ASN1TaggedObject obj, boolean explicit)

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

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

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

        return nextUpdate;
    
public org.bouncycastle.asn1.x509.X509ExtensionsgetSingleExtensions()

        return singleExtensions;
    
public org.bouncycastle.asn1.DERGeneralizedTimegetThisUpdate()

        return thisUpdate;
    
public org.bouncycastle.asn1.DERObjecttoASN1Object()
Produce an object suitable for an ASN1OutputStream.
SingleResponse ::= SEQUENCE {
certID CertID,
certStatus CertStatus,
thisUpdate GeneralizedTime,
nextUpdate [0] EXPLICIT GeneralizedTime OPTIONAL,
singleExtensions [1] EXPLICIT Extensions OPTIONAL }

        ASN1EncodableVector v = new ASN1EncodableVector();

        v.add(certID);
        v.add(certStatus);
        v.add(thisUpdate);

        if (nextUpdate != null)
        {
            v.add(new DERTaggedObject(true, 0, nextUpdate));
        }

        if (singleExtensions != null)
        {
            v.add(new DERTaggedObject(true, 1, singleExtensions));
        }

        return new DERSequence(v);