Esempio n. 1
0
        /**
         * Constructor for a holder for an v2 attribute certificate. *
         *
         * @param seq The ASN.1 sequence.
         */
        private Holder(
            Asn1Sequence seq)
        {
            if (seq.Count > 3)
            {
                throw new ArgumentException("Bad sequence size: " + seq.Count);
            }

            for (int i = 0; i != seq.Count; i++)
            {
                Asn1TaggedObject tObj = Asn1TaggedObject.GetInstance(seq[i]);

                switch (tObj.TagNo)
                {
                case 0:
                    baseCertificateID = IssuerSerial.GetInstance(tObj, false);
                    break;

                case 1:
                    entityName = GeneralNames.GetInstance(tObj, false);
                    break;

                case 2:
                    objectDigestInfo = ObjectDigestInfo.GetInstance(tObj, false);
                    break;

                default:
                    throw new ArgumentException("unknown tag in Holder");
                }
            }

            this.version = 1;
        }
Esempio n. 2
0
        private V2Form(
            Asn1Sequence seq)
        {
            if (seq.Count > 3)
            {
                throw new ArgumentException("Bad sequence size: " + seq.Count);
            }

            int index = 0;

            if (!(seq[0] is Asn1TaggedObject))
            {
                index++;
                this.issuerName = GeneralNames.GetInstance(seq[0]);
            }

            for (int i = index; i != seq.Count; i++)
            {
                Asn1TaggedObject o = Asn1TaggedObject.GetInstance(seq[i]);
                if (o.TagNo == 0)
                {
                    baseCertificateID = IssuerSerial.GetInstance(o, false);
                }
                else if (o.TagNo == 1)
                {
                    objectDigestInfo = ObjectDigestInfo.GetInstance(o, false);
                }
                else
                {
                    throw new ArgumentException("Bad tag number: " + o.TagNo);
                }
            }
        }
Esempio n. 3
0
 /**
  * Constructs a holder from a IssuerSerial.
  * @param baseCertificateID The IssuerSerial.
  * @param version The version of the attribute certificate.
  */
 public Holder(
     IssuerSerial baseCertificateID,
     int version)
 {
     this.baseCertificateID = baseCertificateID;
     this.version           = version;
 }
Esempio n. 4
0
 public V2Form(
     GeneralNames issuerName,
     IssuerSerial baseCertificateID,
     ObjectDigestInfo objectDigestInfo)
 {
     this.issuerName        = issuerName;
     this.baseCertificateID = baseCertificateID;
     this.objectDigestInfo  = objectDigestInfo;
 }
Esempio n. 5
0
        /**
         * Constructor for a holder for an v1 attribute certificate.
         *
         * @param tagObj The ASN.1 tagged holder object.
         */
        public Holder(
            Asn1TaggedObject tagObj)
        {
            switch (tagObj.TagNo)
            {
            case 0:
                baseCertificateID = IssuerSerial.GetInstance(tagObj, false);
                break;

            case 1:
                entityName = GeneralNames.GetInstance(tagObj, false);
                break;

            default:
                throw new ArgumentException("unknown tag in Holder");
            }

            this.version = 0;
        }
Esempio n. 6
0
 public V2Form(GeneralNames issuerName, IssuerSerial baseCertificateID)
     : this(issuerName, baseCertificateID, null)
 {
 }
Esempio n. 7
0
 public Holder(
     IssuerSerial baseCertificateID)
     : this(baseCertificateID, 1)
 {
 }