當前位置: 首頁>>代碼示例>>C#>>正文


C# X509.X509Extensions類代碼示例

本文整理匯總了C#中Org.BouncyCastle.Asn1.X509.X509Extensions的典型用法代碼示例。如果您正苦於以下問題:C# X509Extensions類的具體用法?C# X509Extensions怎麽用?C# X509Extensions使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


X509Extensions類屬於Org.BouncyCastle.Asn1.X509命名空間,在下文中一共展示了X509Extensions類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: SingleResponse

		public SingleResponse(
            Asn1Sequence seq)
        {
            this.certID = CertID.GetInstance(seq[0]);
            this.certStatus = CertStatus.GetInstance(seq[1]);
            this.thisUpdate = (DerGeneralizedTime)seq[2];

			if (seq.Count > 4)
            {
                this.nextUpdate = DerGeneralizedTime.GetInstance(
					(Asn1TaggedObject) seq[3], true);
                this.singleExtensions = X509Extensions.GetInstance(
					(Asn1TaggedObject) seq[4], true);
            }
            else if (seq.Count > 3)
            {
                Asn1TaggedObject o = (Asn1TaggedObject) seq[3];

				if (o.TagNo == 0)
                {
                    this.nextUpdate = DerGeneralizedTime.GetInstance(o, true);
                }
                else
                {
                    this.singleExtensions = X509Extensions.GetInstance(o, true);
                }
            }
        }
開發者ID:KimikoMuffin,項目名稱:bc-csharp,代碼行數:28,代碼來源:SingleResponse.cs

示例2: AttributeCertificateInfo

		private AttributeCertificateInfo(
            Asn1Sequence seq)
        {
			if (seq.Count < 7 || seq.Count > 9)
			{
				throw new ArgumentException("Bad sequence size: " + seq.Count);
			}

			this.version = DerInteger.GetInstance(seq[0]);
            this.holder = Holder.GetInstance(seq[1]);
            this.issuer = AttCertIssuer.GetInstance(seq[2]);
            this.signature = AlgorithmIdentifier.GetInstance(seq[3]);
            this.serialNumber = DerInteger.GetInstance(seq[4]);
            this.attrCertValidityPeriod = AttCertValidityPeriod.GetInstance(seq[5]);
            this.attributes = Asn1Sequence.GetInstance(seq[6]);

			for (int i = 7; i < seq.Count; i++)
            {
                Asn1Encodable obj = (Asn1Encodable) seq[i];

				if (obj is DerBitString)
                {
                    this.issuerUniqueID = DerBitString.GetInstance(seq[i]);
                }
                else if (obj is Asn1Sequence || obj is X509Extensions)
                {
                    this.extensions = X509Extensions.GetInstance(seq[i]);
                }
            }
        }
開發者ID:ktw,項目名稱:OutlookPrivacyPlugin,代碼行數:30,代碼來源:AttributeCertificateInfo.cs

示例3: Generate

        public TimeStampRequest Generate(
			string		digestAlgorithmOid,
			byte[]		digest,
			IBigInteger	nonce)
        {
            if (digestAlgorithmOid == null)
            {
                throw new ArgumentException("No digest algorithm specified");
            }

            DerObjectIdentifier digestAlgOid = new DerObjectIdentifier(digestAlgorithmOid);

            AlgorithmIdentifier algID = new AlgorithmIdentifier(digestAlgOid, DerNull.Instance);
            MessageImprint messageImprint = new MessageImprint(algID, digest);

            X509Extensions  ext = null;

            if (extOrdering.Count != 0)
            {
                ext = new X509Extensions(extOrdering, extensions);
            }

            DerInteger derNonce = nonce == null
                ?	null
                :	new DerInteger(nonce);

            return new TimeStampRequest(
                new TimeStampReq(messageImprint, reqPolicy, derNonce, certReq, ext));
        }
開發者ID:sanyaade-iot,項目名稱:Schmoose-BouncyCastle,代碼行數:29,代碼來源:TimeStampRequestGenerator.cs

示例4: RequestObject

			public RequestObject(
				CertificateID	certId,
				X509Extensions	extensions)
			{
				this.certId = certId;
				this.extensions = extensions;
			}
開發者ID:nicecai,項目名稱:iTextSharp-4.1.6,代碼行數:7,代碼來源:OCSPReqGenerator.cs

示例5: ResponseObject

			private ResponseObject(
				CertificateID		certId,
				CertificateStatus	certStatus,
				DerGeneralizedTime	thisUpdate,
				DerGeneralizedTime	nextUpdate,
				X509Extensions		extensions)
			{
				this.certId = certId;

				if (certStatus == null)
				{
					this.certStatus = new CertStatus();
				}
				else if (certStatus is UnknownStatus)
				{
					this.certStatus = new CertStatus(2, DerNull.Instance);
				}
				else
				{
					RevokedStatus rs = (RevokedStatus) certStatus;
					CrlReason revocationReason = rs.HasRevocationReason
						?	new CrlReason(rs.RevocationReason)
						:	null;

					this.certStatus = new CertStatus(
						new RevokedInfo(new DerGeneralizedTime(rs.RevocationTime), revocationReason));
				}

				this.thisUpdate = thisUpdate;
				this.nextUpdate = nextUpdate;

				this.extensions = extensions;
			}
開發者ID:NicolasDorier,項目名稱:bc-csharp,代碼行數:33,代碼來源:BasicOCSPRespGenerator.cs

示例6: RevDetails

        private RevDetails(Asn1Sequence seq)
		{
			certDetails = CertTemplate.GetInstance(seq[0]);
            crlEntryDetails = seq.Count <= 1
                ?   null
                :   X509Extensions.GetInstance(seq[1]);
		}
開發者ID:KimikoMuffin,項目名稱:bc-csharp,代碼行數:7,代碼來源:RevDetails.cs

示例7: ResponseData

		public ResponseData(
			ResponderID         responderID,
			DerGeneralizedTime  producedAt,
			Asn1Sequence        responses,
			X509Extensions      responseExtensions)
			: this(V1, responderID, producedAt, responses, responseExtensions)
		{
		}
開發者ID:ktw,項目名稱:OutlookPrivacyPlugin,代碼行數:8,代碼來源:ResponseData.cs

示例8: RevDetails

		private RevDetails(Asn1Sequence seq)
		{
			certDetails = CertTemplate.GetInstance(seq[0]);

			if  (seq.Count > 1)
			{
				crlEntryDetails = X509Extensions.GetInstance(seq[1]);
			}
		}
開發者ID:MBrekhof,項目名稱:pleiobox-clients,代碼行數:9,代碼來源:RevDetails.cs

示例9: Request

		public Request(
            CertID			reqCert,
            X509Extensions	singleRequestExtensions)
        {
			if (reqCert == null)
				throw new ArgumentNullException("reqCert");

			this.reqCert = reqCert;
            this.singleRequestExtensions = singleRequestExtensions;
        }
開發者ID:htlp,項目名稱:itextsharp,代碼行數:10,代碼來源:Request.cs

示例10: TbsRequest

		public TbsRequest(
            GeneralName     requestorName,
            Asn1Sequence    requestList,
            X509Extensions  requestExtensions)
        {
            this.version = V1;
            this.requestorName = requestorName;
            this.requestList = requestList;
            this.requestExtensions = requestExtensions;
        }
開發者ID:ktw,項目名稱:OutlookPrivacyPlugin,代碼行數:10,代碼來源:TBSRequest.cs

示例11: Request

		private Request(
			Asn1Sequence seq)
        {
			reqCert = CertID.GetInstance(seq[0]);

			if (seq.Count == 2)
            {
                singleRequestExtensions = X509Extensions.GetInstance(
					(Asn1TaggedObject)seq[1], true);
            }
        }
開發者ID:ktw,項目名稱:OutlookPrivacyPlugin,代碼行數:11,代碼來源:Request.cs

示例12: RevAnnContent

		private RevAnnContent(Asn1Sequence seq)
		{
			status = PkiStatusEncodable.GetInstance(seq[0]);
			certId = CertId.GetInstance(seq[1]);
			willBeRevokedAt = DerGeneralizedTime.GetInstance(seq[2]);
			badSinceDate = DerGeneralizedTime.GetInstance(seq[3]);

			if (seq.Count > 4)
			{
				crlDetails = X509Extensions.GetInstance(seq[4]);
			}
		}
開發者ID:ktw,項目名稱:OutlookPrivacyPlugin,代碼行數:12,代碼來源:RevAnnContent.cs

示例13: TimeStampReq

		public TimeStampReq(
			MessageImprint		messageImprint,
			DerObjectIdentifier	tsaPolicy,
			DerInteger			nonce,
			DerBoolean			certReq,
			X509Extensions		extensions)
		{
			// default
			this.version = new DerInteger(1);

			this.messageImprint = messageImprint;
			this.tsaPolicy = tsaPolicy;
			this.nonce = nonce;
			this.certReq = certReq;
			this.extensions = extensions;
		}
開發者ID:KimikoMuffin,項目名稱:bc-csharp,代碼行數:16,代碼來源:TimeStampReq.cs

示例14: CrlEntry

        public CrlEntry(
			Asn1Sequence seq)
        {
            if (seq.Count < 2 || seq.Count > 3)
            {
                throw new ArgumentException("Bad sequence size: " + seq.Count);
            }

            this.seq = seq;

            userCertificate = DerInteger.GetInstance(seq[0]);
            revocationDate = Time.GetInstance(seq[1]);

            if (seq.Count == 3)
            {
                crlEntryExtensions = X509Extensions.GetInstance(seq[2]);
            }
        }
開發者ID:hjgode,項目名稱:iTextSharpCF,代碼行數:18,代碼來源:TBSCertList.cs

示例15: CertTemplate

        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");
                }
            }
        }
開發者ID:ktw,項目名稱:OutlookPrivacyPlugin,代碼行數:43,代碼來源:CertTemplate.cs


注:本文中的Org.BouncyCastle.Asn1.X509.X509Extensions類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。