Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.bouncycastle.asn1.esf;
  
  
 RevocationValues ::= SEQUENCE {
    crlVals [0] SEQUENCE OF CertificateList OPTIONAL,
    ocspVals [1] SEQUENCE OF BasicOCSPResponse OPTIONAL,
    otherRevVals [2] OtherRevVals OPTIONAL}
 
 
 public class RevocationValues
     extends ASN1Object
 {
 
     private ASN1Sequence crlVals;
     private ASN1Sequence ocspVals;
     private OtherRevVals otherRevVals;
 
     public static RevocationValues getInstance(Object obj)
     {
         if (obj instanceof RevocationValues)
         {
             return (RevocationValues)obj;
         }
         else if (obj != null)
         {
             return new RevocationValues(ASN1Sequence.getInstance(obj));
         }
 
         return null;
     }
 
     private RevocationValues(ASN1Sequence seq)
     {
         if (seq.size() > 3)
         {
             throw new IllegalArgumentException("Bad sequence size: "
                 + seq.size());
         }
         Enumeration e = seq.getObjects();
         while (e.hasMoreElements())
         {
             DERTaggedObject o = (DERTaggedObject)e.nextElement();
             switch (o.getTagNo())
             {
                 case 0:
                     ASN1Sequence crlValsSeq = (ASN1Sequence)o.getObject();
                     Enumeration crlValsEnum = crlValsSeq.getObjects();
                     while (crlValsEnum.hasMoreElements())
                     {
                         CertificateList.getInstance(crlValsEnum.nextElement());
                     }
                     this. = crlValsSeq;
                     break;
                 case 1:
                     ASN1Sequence ocspValsSeq = (ASN1Sequence)o.getObject();
                     Enumeration ocspValsEnum = ocspValsSeq.getObjects();
                     while (ocspValsEnum.hasMoreElements())
                     {
                         BasicOCSPResponse.getInstance(ocspValsEnum.nextElement());
                     }
                     this. = ocspValsSeq;
                     break;
                 case 2:
                     this. = OtherRevVals.getInstance(o.getObject());
                     break;
                 default:
                     throw new IllegalArgumentException("invalid tag: "
                         + o.getTagNo());
             }
         }
     }
 
     public RevocationValues(CertificateList[] crlVals,
                             BasicOCSPResponse[] ocspValsOtherRevVals otherRevVals)
     {
         if (null != crlVals)
         {
             this. = new DERSequence(crlVals);
         }
         if (null != ocspVals)
         {
             this. = new DERSequence(ocspVals);
         }
         this. = otherRevVals;
     }
 
     public CertificateList[] getCrlVals()
    {
        if (null == this.)
        {
            return new CertificateList[0];
        }
        CertificateList[] result = new CertificateList[this..size()];
        for (int idx = 0; idx < result.lengthidx++)
        {
            result[idx] = CertificateList.getInstance(this.
                .getObjectAt(idx));
        }
        return result;
    }
    public BasicOCSPResponse[] getOcspVals()
    {
        if (null == this.)
        {
            return new BasicOCSPResponse[0];
        }
        BasicOCSPResponse[] result = new BasicOCSPResponse[this..size()];
        for (int idx = 0; idx < result.lengthidx++)
        {
            result[idx] = BasicOCSPResponse.getInstance(this.
                .getObjectAt(idx));
        }
        return result;
    }
    public OtherRevVals getOtherRevVals()
    {
        return this.;
    }
    {
        ASN1EncodableVector v = new ASN1EncodableVector();
        if (null != this.)
        {
            v.add(new DERTaggedObject(true, 0, this.));
        }
        if (null != this.)
        {
            v.add(new DERTaggedObject(true, 1, this.));
        }
        if (null != this.)
        {
            v.add(new DERTaggedObject(true, 2, this..toASN1Primitive()));
        }
        return new DERSequence(v);
    }
New to GrepCode? Check out our FAQ X