Inheritance: Asn1Encodable
コード例 #1
0
ファイル: CertTemplate.cs プロジェクト: 894880010/MP
        private CertTemplate(Asn1Sequence seq)
        {
            this.seq = seq;

            foreach (Asn1TaggedObject tObj in seq)
            {
                switch (tObj.TagNo)
                {
                case 0:
                    version = DerInteger.GetInstance(tObj, false);
                    break;

                case 1:
                    serialNumber = DerInteger.GetInstance(tObj, false);
                    break;

                case 2:
                    signingAlg = AlgorithmIdentifier.GetInstance(tObj, false);
                    break;

                case 3:
                    issuer = X509Name.GetInstance(tObj, true); // CHOICE
                    break;

                case 4:
                    validity = OptionalValidity.GetInstance(Asn1Sequence.GetInstance(tObj, false));
                    break;

                case 5:
                    subject = X509Name.GetInstance(tObj, true); // CHOICE
                    break;

                case 6:
                    publicKey = SubjectPublicKeyInfo.GetInstance(tObj, false);
                    break;

                case 7:
                    issuerUID = DerBitString.GetInstance(tObj, false);
                    break;

                case 8:
                    subjectUID = DerBitString.GetInstance(tObj, false);
                    break;

                case 9:
                    extensions = X509Extensions.GetInstance(tObj, false);
                    break;

                default:
                    throw new ArgumentException("unknown tag: " + tObj.TagNo, "seq");
                }
            }
        }
コード例 #2
0
        private CertTemplate(Asn1Sequence seq)
        {
            this.seq = seq;

            foreach (Asn1TaggedObject tObj in seq)
            {
                switch (tObj.TagNo)
                {
                case 0:
                    version = DerInteger.GetInstance(tObj, false);
                    break;
                case 1:
                    serialNumber = DerInteger.GetInstance(tObj, false);
                    break;
                case 2:
                    signingAlg = AlgorithmIdentifier.GetInstance(tObj, false);
                    break;
                case 3:
                    issuer = X509Name.GetInstance(tObj, true); // CHOICE
                    break;
                case 4:
                    validity = OptionalValidity.GetInstance(Asn1Sequence.GetInstance(tObj, false));
                    break;
                case 5:
                    subject = X509Name.GetInstance(tObj, true); // CHOICE
                    break;
                case 6:
                    publicKey = SubjectPublicKeyInfo.GetInstance(tObj, false);
                    break;
                case 7:
                    issuerUID = DerBitString.GetInstance(tObj, false);
                    break;
                case 8:
                    subjectUID = DerBitString.GetInstance(tObj, false);
                    break;
                case 9:
                    extensions = X509Extensions.GetInstance(tObj, false);
                    break;
                default:
                    throw new ArgumentException("unknown tag: " + tObj.TagNo, "seq");
                }
            }
        }
コード例 #3
0
 public virtual CertTemplateBuilder SetValidity(OptionalValidity v)
 {
     validity = v;
     return(this);
 }
コード例 #4
0
 public virtual CertTemplateBuilder SetValidity(OptionalValidity v)
 {
     validity = v;
     return this;
 }
コード例 #5
0
        private CertTemplate(Asn1Sequence seq)
        {
            //IL_011d: Unknown result type (might be due to invalid IL or missing references)
            this.seq = seq;
            global::System.Collections.IEnumerator enumerator = seq.GetEnumerator();
            try
            {
                while (enumerator.MoveNext())
                {
                    Asn1TaggedObject asn1TaggedObject = (Asn1TaggedObject)enumerator.get_Current();
                    switch (asn1TaggedObject.TagNo)
                    {
                    case 0:
                        version = DerInteger.GetInstance(asn1TaggedObject, isExplicit: false);
                        break;

                    case 1:
                        serialNumber = DerInteger.GetInstance(asn1TaggedObject, isExplicit: false);
                        break;

                    case 2:
                        signingAlg = AlgorithmIdentifier.GetInstance(asn1TaggedObject, explicitly: false);
                        break;

                    case 3:
                        issuer = X509Name.GetInstance(asn1TaggedObject, explicitly: true);
                        break;

                    case 4:
                        validity = OptionalValidity.GetInstance(Asn1Sequence.GetInstance(asn1TaggedObject, explicitly: false));
                        break;

                    case 5:
                        subject = X509Name.GetInstance(asn1TaggedObject, explicitly: true);
                        break;

                    case 6:
                        publicKey = SubjectPublicKeyInfo.GetInstance(asn1TaggedObject, explicitly: false);
                        break;

                    case 7:
                        issuerUID = DerBitString.GetInstance(asn1TaggedObject, isExplicit: false);
                        break;

                    case 8:
                        subjectUID = DerBitString.GetInstance(asn1TaggedObject, isExplicit: false);
                        break;

                    case 9:
                        extensions = X509Extensions.GetInstance(asn1TaggedObject, explicitly: false);
                        break;

                    default:
                        throw new ArgumentException(string.Concat((object)"unknown tag: ", (object)asn1TaggedObject.TagNo), "seq");
                    }
                }
            }
            finally
            {
                global::System.IDisposable disposable = enumerator as global::System.IDisposable;
                if (disposable != null)
                {
                    disposable.Dispose();
                }
            }
        }