当前位置: 首页>>代码示例>>C#>>正文


C# Asn1EncodableVector.Add方法代码示例

本文整理汇总了C#中Org.BouncyCastle.Asn1.Asn1EncodableVector.Add方法的典型用法代码示例。如果您正苦于以下问题:C# Asn1EncodableVector.Add方法的具体用法?C# Asn1EncodableVector.Add怎么用?C# Asn1EncodableVector.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Org.BouncyCastle.Asn1.Asn1EncodableVector的用法示例。


在下文中一共展示了Asn1EncodableVector.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: toASN1Primitive

 public Asn1Object toASN1Primitive()
 {
     Asn1EncodableVector dev = new Asn1EncodableVector();
     dev.Add(this.sigPolicyQualifierId);
     dev.Add(this.sigQualifier);
     return new DerSequence(dev);
 }
开发者ID:bibou1324,项目名称:clienteafirma,代码行数:7,代码来源:AOSigPolicyQualifierInfo.cs

示例2: ToAsn1Object

		public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector v = new Asn1EncodableVector();

			if (version != null)
            {
                v.Add(version);
            }

			v.Add(iv);

			return new DerSequence(v);
        }
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:13,代码来源:RC2CBCParameter.cs

示例3: GetPkiStatusInfo

        private PkiStatusInfo GetPkiStatusInfo()
        {
            Asn1EncodableVector v = new Asn1EncodableVector(
                new DerInteger((int)status));

            if (statusStrings.Count > 0)
            {
                v.Add(new PkiFreeText(new DerSequence(statusStrings)));
            }

            if (failInfo != 0)
            {
                v.Add(new FailInfo(failInfo));
            }

            return new PkiStatusInfo(new DerSequence(v));
        }
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:17,代码来源:TimeStampResponseGenerator.cs

示例4: CreateBerSetFromList

 public static Asn1Set CreateBerSetFromList(List<Asn1Encodable> derObjects)
 {
     Asn1EncodableVector v = new Asn1EncodableVector();
     foreach (Asn1Encodable d in derObjects)
     {
         v.Add(d);
     }
     return new BerSet(v);
 }
开发者ID:bibou1324,项目名称:clienteafirma,代码行数:9,代码来源:SigUtils.cs

示例5: WriteTo

        /// <summary>
        /// Write myself to the given stream
        /// </summary>
        public void WriteTo(Stream stream, out string md5FingerPrint, out string sha1FingerPrint)
        {
            X509Certificate[] cert;
            AsymmetricKeyEntry privateKey;
            LoadPfx(out cert, out privateKey);

            var certsVector = new Asn1EncodableVector();
            md5FingerPrint = null;
            sha1FingerPrint = null;
            foreach (var c in cert)
            {
                var certStream = new MemoryStream(c.GetEncoded());
                var certStruct = X509CertificateStructure.GetInstance(new Asn1InputStream(certStream).ReadObject());
                certsVector.Add(certStruct);

                if (md5FingerPrint == null)
                {
                    var certData = certStream.ToArray();
                    md5FingerPrint = CreateFingerprint(new MD5Digest(), certData);
                }

                if (sha1FingerPrint == null)
                {
                    var certData = certStream.ToArray();
                    sha1FingerPrint = CreateFingerprint(new Sha1Digest(), certData);
                }
            }

            var encryptedSignature = GetSignature(signature, privateKey.Key);
            var signerInfo = new SignerInfo(
                new DerInteger(1),
                new IssuerAndSerialNumber(cert[0].IssuerDN, cert[0].SerialNumber),
                new AlgorithmIdentifier(Oids.SHA1, DerNull.Instance),
                null,
                new AlgorithmIdentifier(Oids.RSA, DerNull.Instance),
                new DerOctetString(encryptedSignature),
                null);

            var pkcs7 = new SignedData(
                new DerInteger(1),
                new DerSet(new AlgorithmIdentifier(Oids.SHA1, DerNull.Instance)),
                new ContentInfo(new DerObjectIdentifier(Oids.data), null),
                new DerSet(certsVector),
                null,
                new DerSet(signerInfo));

            //var signedData = new ContentInfo(new DERObjectIdentifier(Oids.signedData), pkcs7);

            var v = new Asn1EncodableVector();
            v.Add(new DerObjectIdentifier(Oids.signedData));
            v.Add(new DerTaggedObject(0, pkcs7));            
            var signedData = new DerSequence(v);

            // Save
            var data = signedData.GetEncoded();
            stream.Write(data, 0, data.Length);
        }
开发者ID:Xtremrules,项目名称:dot42,代码行数:60,代码来源:MetaInfCertRsaBuilder.cs

示例6: FromEnumerable

		public static Asn1EncodableVector FromEnumerable(
			IEnumerable e)
		{
			Asn1EncodableVector v = new Asn1EncodableVector();
			foreach (Asn1Encodable obj in e)
			{
				v.Add(obj);
			}
			return v;
		}
开发者ID:nicecai,项目名称:iTextSharp-4.1.6,代码行数:10,代码来源:Asn1EncodableVector.cs

示例7: ToAsn1Object

		public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector seq = new Asn1EncodableVector(qcStatementId);

			if (qcStatementInfo != null)
            {
                seq.Add(qcStatementInfo);
            }

			return new DerSequence(seq);
        }
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:11,代码来源:QCStatement.cs

示例8: ToAsn1Object

		/**
		 * Produce an object suitable for an Asn1OutputStream.
		 * <pre>
		 * ContentInfo ::= Sequence {
		 *          contentType ContentType,
		 *          content
		 *          [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
		 * </pre>
		 */
		public override Asn1Object ToAsn1Object()
		{
			Asn1EncodableVector v = new Asn1EncodableVector(contentType);

			if (content != null)
			{
				v.Add(new BerTaggedObject(0, content));
			}

			return new BerSequence(v);
		}
开发者ID:nicecai,项目名称:iTextSharp-4.1.6,代码行数:20,代码来源:ContentInfo.cs

示例9: ToAsn1Object

		/**
         * Produce an object suitable for an Asn1OutputStream.
         * <pre>
         * Request         ::=     Sequence {
         *     reqCert                     CertID,
         *     singleRequestExtensions     [0] EXPLICIT Extensions OPTIONAL }
         * </pre>
         */
        public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector v = new Asn1EncodableVector(reqCert);

			if (singleRequestExtensions != null)
            {
                v.Add(new DerTaggedObject(true, 0, singleRequestExtensions));
            }

			return new DerSequence(v);
        }
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:19,代码来源:Request.cs

示例10: ToAsn1Object

		/**
         * Produce an object suitable for an Asn1OutputStream.
         * <pre>
         * OcspRequest     ::=     Sequence {
         *     tbsRequest                  TBSRequest,
         *     optionalSignature   [0]     EXPLICIT Signature OPTIONAL }
         * </pre>
         */
        public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector v = new Asn1EncodableVector(tbsRequest);

			if (optionalSignature != null)
            {
                v.Add(new DerTaggedObject(true, 0, optionalSignature));
            }

			return new DerSequence(v);
        }
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:19,代码来源:OCSPRequest.cs

示例11: ToAsn1Object

		public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector v = new Asn1EncodableVector(p, g);

			if (this.l != null)
            {
                v.Add(l);
            }

			return new DerSequence(v);
        }
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:11,代码来源:DHParameter.cs

示例12: ToAsn1Object

		/**
         * Produce an object suitable for an Asn1OutputStream.
         * <pre>
         * OcspResponse ::= Sequence {
         *     responseStatus         OcspResponseStatus,
         *     responseBytes          [0] EXPLICIT ResponseBytes OPTIONAL }
         * </pre>
         */
        public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector v = new Asn1EncodableVector(responseStatus);

			if (responseBytes != null)
            {
                v.Add(new DerTaggedObject(true, 0, responseBytes));
            }

			return new DerSequence(v);
        }
开发者ID:MBrekhof,项目名称:pleiobox-clients,代码行数:19,代码来源:OCSPResponse.cs

示例13: BuildEncodableVector

		internal Asn1EncodableVector BuildEncodableVector()
		{
			Asn1EncodableVector v = new Asn1EncodableVector();

			Asn1Object o;
			while ((o = ReadObject()) != null)
			{
				v.Add(o);
			}

			return v;
		}
开发者ID:nicecai,项目名称:iTextSharp-4.1.6,代码行数:12,代码来源:Asn1InputStream.cs

示例14: ToAsn1Object

		public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector v = new Asn1EncodableVector(
				bagID, new DerTaggedObject(0, bagValue));

			if (bagAttributes != null)
            {
                v.Add(bagAttributes);
            }

			return new DerSequence(v);
        }
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:12,代码来源:SafeBag.cs

示例15: CreateDerSetFromList

        public static Asn1Set CreateDerSetFromList(
			IList derObjects)
        {
            Asn1EncodableVector v = new Asn1EncodableVector();

            foreach (Asn1Encodable ae in derObjects)
            {
                v.Add(ae);
            }

            return new DerSet(v);
        }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:12,代码来源:CMSUtils.cs


注:本文中的Org.BouncyCastle.Asn1.Asn1EncodableVector.Add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。