當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。