Ejemplo n.º 1
0
        public Holder(
            ASN1Sequence seq)
        {
            for (int i = 0; i != seq.size(); i++)
            {
                ASN1TaggedObject tObj = (ASN1TaggedObject)seq.getObjectAt(i);

                switch (tObj.getTagNo())
                {
                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");
                }
            }
        }
Ejemplo n.º 2
0
        public V2Form(
            ASN1Sequence seq)
        {
            int index = 0;

            if (!(seq.getObjectAt(0) is ASN1TaggedObject))
            {
                index++;
                this.issuerName = GeneralNames.getInstance(seq.getObjectAt(0));
            }

            for (int i = index; i != seq.size(); i++)
            {
                ASN1TaggedObject o = (ASN1TaggedObject)seq.getObjectAt(i);
                if (o.getTagNo() == 0)
                {
                    baseCertificateID = IssuerSerial.getInstance(o, false);
                }
                else if (o.getTagNo() == 1)
                {
                    objectDigestInfo = ObjectDigestInfo.getInstance(o, false);
                }
            }
        }