• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# Asn1Object类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Asn1Object类属于命名空间,在下文中一共展示了Asn1Object类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: SigPolicyQualifierInfo

		public SigPolicyQualifierInfo(
			DerObjectIdentifier	sigPolicyQualifierId,
			Asn1Encodable		sigQualifier)
		{
			this.sigPolicyQualifierId = sigPolicyQualifierId;
			this.sigQualifier = sigQualifier.ToAsn1Object();
		}
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:7,代码来源:SigPolicyQualifierInfo.cs


示例2: PrivateKeyInfo

        private PrivateKeyInfo(
            Asn1Sequence seq)
        {
            IEnumerator e = seq.GetEnumerator();

            e.MoveNext();
            IBigInteger version = ((DerInteger) e.Current).Value;
            if (version.IntValue != 0)
            {
                throw new ArgumentException("wrong version for private key info");
            }

            e.MoveNext();
            algID = AlgorithmIdentifier.GetInstance(e.Current);

            try
            {
                e.MoveNext();
                Asn1OctetString data = (Asn1OctetString) e.Current;

                privKey = Asn1Object.FromByteArray(data.GetOctets());
            }
            catch (IOException)
            {
                throw new ArgumentException("Error recoverying private key from sequence");
            }

            if (e.MoveNext())
            {
                attributes = Asn1Set.GetInstance((Asn1TaggedObject) e.Current, false);
            }
        }
开发者ID:sanyaade-iot,项目名称:Schmoose-BouncyCastle,代码行数:32,代码来源:PrivateKeyInfo.cs


示例3: GeneralName

		/**
         * When the subjectAltName extension contains an Internet mail address,
         * the address MUST be included as an rfc822Name. The format of an
         * rfc822Name is an "addr-spec" as defined in RFC 822 [RFC 822].
         *
         * When the subjectAltName extension contains a domain name service
         * label, the domain name MUST be stored in the dNSName (an IA5String).
         * The name MUST be in the "preferred name syntax," as specified by RFC
         * 1034 [RFC 1034].
         *
         * When the subjectAltName extension contains a URI, the name MUST be
         * stored in the uniformResourceIdentifier (an IA5String). The name MUST
         * be a non-relative URL, and MUST follow the URL syntax and encoding
         * rules specified in [RFC 1738].  The name must include both a scheme
         * (e.g., "http" or "ftp") and a scheme-specific-part.  The scheme-
         * specific-part must include a fully qualified domain name or IP
         * address as the host.
         *
         * When the subjectAltName extension contains a iPAddress, the address
         * MUST be stored in the octet string in "network byte order," as
         * specified in RFC 791 [RFC 791]. The least significant bit (LSB) of
         * each octet is the LSB of the corresponding byte in the network
         * address. For IP Version 4, as specified in RFC 791, the octet string
         * MUST contain exactly four octets.  For IP Version 6, as specified in
         * RFC 1883, the octet string MUST contain exactly sixteen octets [RFC
         * 1883].
         */
        public GeneralName(
            Asn1Object	name,
			int			tag)
        {
            this.obj = name;
            this.tag = tag;
        }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:34,代码来源:GeneralName.cs


示例4: CertBag

		public CertBag(
            DerObjectIdentifier	certID,
            Asn1Object			certValue)
        {
            this.certID = certID;
            this.certValue = certValue;
        }
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:7,代码来源:CertBag.cs


示例5: PrivateKeyInfo

 public PrivateKeyInfo(
     AlgorithmIdentifier	algID,
     Asn1Object			privateKey,
     Asn1Set				attributes)
 {
     this.algID = algID;
     this.privKey = new DerOctetString(privateKey.GetEncoded(Asn1Encodable.Der));
     this.attributes = attributes;
 }
开发者ID:ALange,项目名称:OutlookPrivacyPlugin,代码行数:9,代码来源:PrivateKeyInfo.cs


示例6: ServiceLocator

		private ServiceLocator(
			Asn1Sequence seq)
		{
			this.issuer = X509Name.GetInstance(seq[0]);

			if (seq.Count > 1)
			{
				this.locator = seq[1].ToAsn1Object();
			}
		}
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:10,代码来源:ServiceLocator.cs


示例7: Time

        public Time(
            Asn1Object time)
        {
            if (time == null)
                throw new ArgumentNullException("time");
            if (!(time is DerUtcTime) && !(time is DerGeneralizedTime))
                throw new ArgumentException("unknown object passed to Time");

            this.time = time;
        }
开发者ID:NicolasDorier,项目名称:bc-csharp,代码行数:10,代码来源:Time.cs


示例8: OtherRevRefs

		private OtherRevRefs(
			Asn1Sequence seq)
		{
			if (seq == null)
				throw new ArgumentNullException("seq");
			if (seq.Count != 2)
				throw new ArgumentException("Bad sequence size: " + seq.Count, "seq");

			this.otherRevRefType = (DerObjectIdentifier) seq[0].ToAsn1Object();
			this.otherRevRefs = seq[1].ToAsn1Object();
		}
开发者ID:MBrekhof,项目名称:pleiobox-clients,代码行数:11,代码来源:OtherRevRefs.cs


示例9: CommitmentTypeQualifier

    /**
        * Creates a new <code>CommitmentTypeQualifier</code> instance.
        *
        * @param commitmentTypeIdentifier a <code>CommitmentTypeIdentifier</code> value
        * @param qualifier the qualifier, defined by the above field.
        */
        public CommitmentTypeQualifier(
            DerObjectIdentifier	commitmentTypeIdentifier,
            Asn1Encodable		qualifier)
        {
			if (commitmentTypeIdentifier == null)
				throw new ArgumentNullException("commitmentTypeIdentifier");

			this.commitmentTypeIdentifier = commitmentTypeIdentifier;

			if (qualifier != null)
			{
				this.qualifier = qualifier.ToAsn1Object();
			}
        }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:20,代码来源:CommitmentTypeQualifier.cs


示例10: X9FieldID

 private X9FieldID(Asn1Sequence seq)
 {
     this.id = DerObjectIdentifier.GetInstance(seq[0]);
     this.parameters = seq[1].ToAsn1Object();
 }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:5,代码来源:X9FieldID.cs


示例11: AsString

        /**
         * dump a Der object as a formatted string with indentation
         *
         * @param obj the Asn1Object to be dumped out.
         */
        private static string AsString(
            string		indent,
            Asn1Object	obj)
        {
            if (obj is Asn1Sequence)
            {
                StringBuilder    Buffer = new StringBuilder();
                string          tab = indent + TAB;

                Buffer.Append(indent);
                if (obj is DerSequence)
                {
                    Buffer.Append("DER Sequence");
                }
                else if (obj is BerSequence)
                {
                    Buffer.Append("BER Sequence");
                }
                else
                {
                    Buffer.Append("Sequence");
                }

                Buffer.Append(
            // MASC 20070308. CF compatibility patch
            #if !NETCF
                    Environment.NewLine
            #else
                    EnvironmentEx.NewLine
            #endif
                );

                foreach (object o in ((Asn1Sequence)obj))
                {
                    if (o == null || o.Equals(DerNull.Instance))
                    {
                        Buffer.Append(tab);
                        Buffer.Append("Null");
                        Buffer.Append(
            // MASC 20070308. CF compatibility patch
            #if !NETCF
                            Environment.NewLine
            #else
                            EnvironmentEx.NewLine
            #endif
                        );
                    }
                    else if (o is Asn1Object)
                    {
                        Buffer.Append(AsString(tab, (Asn1Object)o));
                    }
                    else
                    {
                        Buffer.Append(AsString(tab, ((Asn1Encodable)o).ToAsn1Object()));
                    }
                }
                return Buffer.ToString();
            }
            else if (obj is DerTaggedObject)
            {
                StringBuilder Buffer = new StringBuilder();
                string tab = indent + TAB;

                Buffer.Append(indent);
                if (obj is BerTaggedObject)
                {
                    Buffer.Append("BER Tagged [");
                }
                else
                {
                    Buffer.Append("Tagged [");
                }

                DerTaggedObject o = (DerTaggedObject)obj;

                Buffer.Append(((int)o.TagNo).ToString());
                Buffer.Append(']');

                if (!o.IsExplicit())
                {
                    Buffer.Append(" IMPLICIT ");
                }

                Buffer.Append(
            // MASC 20070308. CF compatibility patch
            #if !NETCF
                    Environment.NewLine
            #else
                    EnvironmentEx.NewLine
            #endif
                );

                if (o.IsEmpty())
                {
                    Buffer.Append(tab);
//.........这里部分代码省略.........
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:101,代码来源:Asn1Dump.cs


示例12: AsString

        /**
         * dump a Der object as a formatted string with indentation
         *
         * @param obj the Asn1Object to be dumped out.
         */
        private static void AsString(
            string			indent,
            bool			verbose,
            Asn1Object		obj,
            StringBuilder	buf)
        {
            if (obj is Asn1Sequence)
            {
                string tab = indent + Tab;
                buf.Append(indent);
                if (obj is BerSequence)
                {
                    buf.Append("BER Sequence");
                }
                else if (obj is DerSequence)
                {
                    buf.Append("DER Sequence");
                }
                else
                {
                    buf.Append("Sequence");
                }

                buf.Append(NewLine);

                foreach (Asn1Encodable o in ((Asn1Sequence)obj))
                {
                    if (o == null || o is Asn1Null)
                    {
                        buf.Append(tab);
                        buf.Append("NULL");
                        buf.Append(NewLine);
                    }
                    else
                    {
                        AsString(tab, verbose, o.ToAsn1Object(), buf);
                    }
                }
            }
            else if (obj is DerTaggedObject)
            {
                string tab = indent + Tab;
                buf.Append(indent);
                if (obj is BerTaggedObject)
                {
                    buf.Append("BER Tagged [");
                }
                else
                {
                    buf.Append("Tagged [");
                }

                DerTaggedObject o = (DerTaggedObject)obj;

                buf.Append(((int)o.TagNo).ToString());
                buf.Append(']');

                if (!o.IsExplicit())
                {
                    buf.Append(" IMPLICIT ");
                }

                buf.Append(NewLine);

                if (o.IsEmpty())
                {
                    buf.Append(tab);
                    buf.Append("EMPTY");
                    buf.Append(NewLine);
                }
                else
                {
                    AsString(tab, verbose, o.GetObject(), buf);
                }
            }
            else if (obj is BerSet)
            {
                string tab = indent + Tab;

                buf.Append(indent);
                buf.Append("BER Set");
                buf.Append(NewLine);

                foreach (Asn1Encodable o in ((Asn1Set)obj))
                {
                    if (o == null)
                    {
                        buf.Append(tab);
                        buf.Append("NULL");
                        buf.Append(NewLine);
                    }
                    else
                    {
                        AsString(tab, verbose, o.ToAsn1Object(), buf);
                    }
//.........这里部分代码省略.........
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:101,代码来源:Asn1Dump.cs


示例13: OriginatorIdentifierOrKey

 public OriginatorIdentifierOrKey(
     Asn1Object id)
 {
     this.id = id;
 }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:5,代码来源:OriginatorIdentifierOrKey.cs


示例14: AsString

        /**
         * dump a Der object as a formatted string with indentation
         *
         * @param obj the Asn1Object to be dumped out.
         */
        private static string AsString(
            string		indent,
            bool		verbose,
            Asn1Object	obj)
        {
            if (obj is Asn1Sequence)
            {
                StringBuilder buf = new StringBuilder(indent);

				string tab = indent + Tab;

                if (obj is BerSequence)
                {
                    buf.Append("BER Sequence");
                }
                else if (obj is DerSequence)
                {
                    buf.Append("DER Sequence");
                }
                else
                {
                    buf.Append("Sequence");
                }

                buf.Append(NewLine);

				foreach (Asn1Encodable o in ((Asn1Sequence)obj))
				{
                    if (o == null || o is Asn1Null)
                    {
                        buf.Append(tab);
                        buf.Append("NULL");
                        buf.Append(NewLine);
                    }
                    else
                    {
                        buf.Append(AsString(tab, verbose, o.ToAsn1Object()));
                    }
                }
                return buf.ToString();
            }
            else if (obj is DerTaggedObject)
            {
                StringBuilder buf = new StringBuilder();
                string tab = indent + Tab;

				buf.Append(indent);
                if (obj is BerTaggedObject)
                {
                    buf.Append("BER Tagged [");
                }
                else
                {
                    buf.Append("Tagged [");
                }

				DerTaggedObject o = (DerTaggedObject)obj;

				buf.Append(((int)o.TagNo).ToString());
                buf.Append(']');

				if (!o.IsExplicit())
                {
                    buf.Append(" IMPLICIT ");
                }

				buf.Append(NewLine);

				if (o.IsEmpty())
                {
                    buf.Append(tab);
                    buf.Append("EMPTY");
                    buf.Append(NewLine);
                }
                else
                {
                    buf.Append(AsString(tab, verbose, o.GetObject()));
                }

				return buf.ToString();
            }
            else if (obj is BerSet)
            {
                StringBuilder buf = new StringBuilder();
                string tab = indent + Tab;

				buf.Append(indent);
                buf.Append("BER Set");
                buf.Append(NewLine);

				foreach (Asn1Encodable o in ((Asn1Set)obj))
				{
                    if (o == null)
                    {
                        buf.Append(tab);
//.........这里部分代码省略.........
开发者ID:nicecai,项目名称:iTextSharp-4.1.6,代码行数:101,代码来源:Asn1Dump.cs


示例15: RecipientIdentifier

		public RecipientIdentifier(
            Asn1Object id)
        {
            this.id = id;
        }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:5,代码来源:RecipientIdentifier.cs


示例16: X9FieldID

		/**
		 * Constructor for elliptic curves over binary fields
		 * <code>F<sub>2<sup>m</sup></sub></code>.
		 * @param m  The exponent <code>m</code> of
		 * <code>F<sub>2<sup>m</sup></sub></code>.
		 * @param k1 The integer <code>k1</code> where <code>x<sup>m</sup> +
		 * x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
		 * represents the reduction polynomial <code>f(z)</code>.
		 * @param k2 The integer <code>k2</code> where <code>x<sup>m</sup> +
		 * x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
		 * represents the reduction polynomial <code>f(z)</code>.
		 * @param k3 The integer <code>k3</code> where <code>x<sup>m</sup> +
		 * x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
		 * represents the reduction polynomial <code>f(z)</code>..
		 */
		public X9FieldID(
			int m,
			int k1,
			int k2,
			int k3)
		{
			this.id = X9ObjectIdentifiers.CharacteristicTwoField;

			Asn1EncodableVector fieldIdParams = new Asn1EncodableVector(new DerInteger(m));

			if (k2 == 0)
			{
				fieldIdParams.Add(
					X9ObjectIdentifiers.TPBasis,
					new DerInteger(k1));
			}
			else
			{
				fieldIdParams.Add(
					X9ObjectIdentifiers.PPBasis,
					new DerSequence(
						new DerInteger(k1),
						new DerInteger(k2),
						new DerInteger(k3)));
			}

			this.parameters = new DerSequence(fieldIdParams);
		}
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:43,代码来源:X9FieldID.cs


示例17: Time

		/**
         * creates a time object from a given date - if the date is between 1950
         * and 2049 a UTCTime object is Generated, otherwise a GeneralizedTime
         * is used.
         */
        public Time(
            DateTime date)
        {
            string d = date.ToString("yyyyMMddHHmmss") + "Z";

			int year = Int32.Parse(d.Substring(0, 4));

			if (year < 1950 || year > 2049)
            {
                time = new DerGeneralizedTime(d);
            }
            else
            {
                time = new DerUtcTime(d.Substring(2));
            }
        }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:21,代码来源:Time.cs


示例18: X9FieldID

		/**
         * Constructor for elliptic curves over binary fields
         * <code>F<sub>2<sup>m</sup></sub></code>.
         * @param m  The exponent <code>m</code> of
         * <code>F<sub>2<sup>m</sup></sub></code>.
         * @param k1 The integer <code>k1</code> where <code>x<sup>m</sup> +
         * x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
         * represents the reduction polynomial <code>f(z)</code>.
         * @param k2 The integer <code>k2</code> where <code>x<sup>m</sup> +
         * x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
         * represents the reduction polynomial <code>f(z)</code>.
         * @param k3 The integer <code>k3</code> where <code>x<sup>m</sup> +
         * x<sup>k3</sup> + x<sup>k2</sup> + x<sup>k1</sup> + 1</code>
         * represents the reduction polynomial <code>f(z)</code>..
         */
		public X9FieldID(
			int m,
			int k1,
			int k2,
			int k3)
		{
			this.id = X9ObjectIdentifiers.CharacteristicTwoField;

			Asn1EncodableVector fieldIdParams = new Asn1EncodableVector(new DerInteger(m));

			if(k2 == 0)
			{
				if(k3 != 0)
					throw new ArgumentException("inconsistent k values");

				fieldIdParams.Add(
					X9ObjectIdentifiers.TPBasis,
					new DerInteger(k1));
			}
			else
			{
				if(k2 <= k1 || k3 <= k2)
					throw new ArgumentException("inconsistent k values");

				fieldIdParams.Add(
					X9ObjectIdentifiers.PPBasis,
					new DerSequence(
						new DerInteger(k1),
						new DerInteger(k2),
						new DerInteger(k3)));
			}

			this.parameters = new DerSequence(fieldIdParams);
		}
开发者ID:Nethereum,项目名称:Nethereum,代码行数:49,代码来源:X9FieldID.cs


示例19: AttCertIssuer

		public AttCertIssuer(
            V2Form v2Form)
        {
            obj = v2Form;
            choiceObj = new DerTaggedObject(false, 0, obj);
        }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:6,代码来源:AttCertIssuer.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Asn1OctetString类代码示例发布时间:2022-05-24
下一篇:
C# Asn1EncodableVector类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap