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


C# Asn1.Asn1EncodableVector类代码示例

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


Asn1EncodableVector类属于Org.BouncyCastle.Asn1命名空间,在下文中一共展示了Asn1EncodableVector类的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: DerSequence

		/**
		 * create a sequence containing a vector of objects.
		 */
		public DerSequence(
			Asn1EncodableVector v)
			: base(v.Count)
		{
			foreach (Asn1Encodable ae in v)
			{
				AddObject(ae);
			}
		}
开发者ID:JohnMalmsteen,项目名称:mobile-apps-tower-defense,代码行数:12,代码来源:DerSequence.cs

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: ToAsn1Object

		/**
        * <pre>
        * CommitmentTypeIndication ::= SEQUENCE {
        *      commitmentTypeId   CommitmentTypeIdentifier,
        *      commitmentTypeQualifier   SEQUENCE SIZE (1..MAX) OF
        *              CommitmentTypeQualifier OPTIONAL }
        * </pre>
        */
        public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector v = new Asn1EncodableVector(commitmentTypeId);

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

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

示例11: ToAsn1Object

		/**
		 * <pre>
		 * MacData ::= SEQUENCE {
		 *     mac      DigestInfo,
		 *     macSalt  OCTET STRING,
		 *     iterations INTEGER DEFAULT 1
		 *     -- Note: The default is for historic reasons and its use is deprecated. A
		 *     -- higher value, like 1024 is recommended.
		 * </pre>
		 * @return the basic DERObject construction.
		 */
		public override Asn1Object ToAsn1Object()
        {
			Asn1EncodableVector v = new Asn1EncodableVector(digInfo, new DerOctetString(salt));

			if (!iterationCount.Equals(BigInteger.One))
			{
				v.Add(new DerInteger(iterationCount));
			}

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

示例12: ToAsn1Object

		/**
         * Produce an object suitable for an Asn1OutputStream.
         * <pre>
         * RevokedInfo ::= Sequence {
         *      revocationTime              GeneralizedTime,
         *      revocationReason    [0]     EXPLICIT CRLReason OPTIONAL }
         * </pre>
         */
        public override Asn1Object ToAsn1Object()
        {
			Asn1EncodableVector v = new Asn1EncodableVector(revocationTime);

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

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

示例13: ToAsn1Object

		/**
         * Produce an object suitable for an Asn1OutputStream.
         * <pre>
         * ServiceLocator ::= Sequence {
         *     issuer    Name,
         *     locator   AuthorityInfoAccessSyntax OPTIONAL }
         * </pre>
         */
        public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector v = new Asn1EncodableVector(issuer);

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

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

示例14: 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

示例15: ToAsn1Object

		/**
         * Produce an object suitable for an Asn1OutputStream.
         * <pre>
         * IDEA-CBCPar ::= Sequence {
         *                      iv    OCTET STRING OPTIONAL -- exactly 8 octets
         *                  }
         * </pre>
         */
        public override Asn1Object ToAsn1Object()
        {
            Asn1EncodableVector v = new Asn1EncodableVector();

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

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


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