Example #1
0
 public RevocationValues(CertificateList[] crlVals, BasicOcspResponse[] ocspVals, OtherRevVals otherRevVals)
 {
     if (crlVals != null)
     {
         this.crlVals = new DerSequence(crlVals);
     }
     if (ocspVals != null)
     {
         this.ocspVals = new DerSequence(ocspVals);
     }
     this.otherRevVals = otherRevVals;
 }
Example #2
0
    private RevocationValues(Asn1Sequence seq)
    {
        if (seq == null)
        {
            throw new ArgumentNullException("seq");
        }
        if (seq.Count > 3)
        {
            throw new ArgumentException("Bad sequence size: " + seq.Count, "seq");
        }
        foreach (Asn1TaggedObject item in seq)
        {
            Asn1Object @object = item.GetObject();
            switch (item.TagNo)
            {
            case 0:
            {
                Asn1Sequence asn1Sequence2 = (Asn1Sequence)@object;
                foreach (Asn1Encodable item2 in asn1Sequence2)
                {
                    CertificateList.GetInstance(item2.ToAsn1Object());
                }
                crlVals = asn1Sequence2;
                break;
            }

            case 1:
            {
                Asn1Sequence asn1Sequence = (Asn1Sequence)@object;
                foreach (Asn1Encodable item3 in asn1Sequence)
                {
                    BasicOcspResponse.GetInstance(item3.ToAsn1Object());
                }
                ocspVals = asn1Sequence;
                break;
            }

            case 2:
                otherRevVals = OtherRevVals.GetInstance(@object);
                break;

            default:
                throw new ArgumentException("Illegal tag in RevocationValues", "seq");
            }
        }
    }
Example #3
0
 public RevocationValues(IEnumerable crlVals, IEnumerable ocspVals, OtherRevVals otherRevVals)
 {
     if (crlVals != null)
     {
         if (!CollectionUtilities.CheckElementsAreOfType(crlVals, typeof(CertificateList)))
         {
             throw new ArgumentException("Must contain only 'CertificateList' objects", "crlVals");
         }
         this.crlVals = new DerSequence(Asn1EncodableVector.FromEnumerable(crlVals));
     }
     if (ocspVals != null)
     {
         if (!CollectionUtilities.CheckElementsAreOfType(ocspVals, typeof(BasicOcspResponse)))
         {
             throw new ArgumentException("Must contain only 'BasicOcspResponse' objects", "ocspVals");
         }
         this.ocspVals = new DerSequence(Asn1EncodableVector.FromEnumerable(ocspVals));
     }
     this.otherRevVals = otherRevVals;
 }