コード例 #1
0
        public CrlID(
            ASN1Sequence seq)
        {
            IEnumerator e = seq.getObjects();

            while (e.MoveNext())
            {
                ASN1TaggedObject o = (ASN1TaggedObject)e.Current;

                switch ((int)o.getTagNo())
                {
                case 0:
                    crlUrl = DERIA5String.getInstance(o, true);
                    break;

                case 1:
                    crlNum = DERInteger.getInstance(o, true);
                    break;

                case 2:
                    crlTime = DERGeneralizedTime.getInstance(o, true);
                    break;

                default:
                    throw new ArgumentException(
                              "unknown tag number: " + o.getTagNo());
                }
            }
        }
コード例 #2
0
        public static GeneralName getInstance(
            object obj)
        {
            if (obj == null || obj is GeneralName)
            {
                return((GeneralName)obj);
            }

            if (obj is ASN1TaggedObject)
            {
                ASN1TaggedObject tagObj = (ASN1TaggedObject)obj;
                int tag = (int)tagObj.getTagNo();

                switch (tag)
                {
                case 0:
                    return(new GeneralName(tagObj.getObject(), tag));

                case 1:
                    return(new GeneralName(DERIA5String.getInstance(tagObj, false), tag));

                case 2:
                    return(new GeneralName(DERIA5String.getInstance(tagObj, false), tag));

                case 3:
                    throw new ArgumentException("unknown tag: " + tag);

                case 4:
                    return(new GeneralName(tagObj.getObject(), tag));

                case 5:
                    return(new GeneralName(tagObj.getObject(), tag));

                case 6:
                    return(new GeneralName(DERIA5String.getInstance(tagObj, false), tag));

                case 7:
                    return(new GeneralName(ASN1OctetString.getInstance(tagObj, false), tag));

                case 8:
                    return(new GeneralName(DERObjectIdentifier.getInstance(tagObj, false), tag));
                }
            }

            throw new ArgumentException("unknown object in getInstance");
        }
コード例 #3
0
 public NetscapeRevocationURL(DERIA5String str) : base(str.getString())
 {
 }
コード例 #4
0
 public VerisignCzagExtension(DERIA5String str) : base(str.getString())
 {
 }