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

C# Asn1Set类代码示例

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

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



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

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


示例2: OriginatorInfo

		public OriginatorInfo(
            Asn1Sequence seq)
        {
            switch (seq.Count)
            {
            case 0:     // empty
                break;
            case 1:
                Asn1TaggedObject o = (Asn1TaggedObject) seq[0];
                switch (o.TagNo)
                {
                case 0 :
                    certs = Asn1Set.GetInstance(o, false);
                    break;
                case 1 :
                    crls = Asn1Set.GetInstance(o, false);
                    break;
                default:
                    throw new ArgumentException("Bad tag in OriginatorInfo: " + o.TagNo);
                }
                break;
            case 2:
                certs = Asn1Set.GetInstance((Asn1TaggedObject) seq[0], false);
                crls  = Asn1Set.GetInstance((Asn1TaggedObject) seq[1], false);
                break;
            default:
                throw new ArgumentException("OriginatorInfo too big");
            }
        }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:29,代码来源:OriginatorInfo.cs


示例3: AttributeX509

		public AttributeX509(
            DerObjectIdentifier	attrType,
            Asn1Set				attrValues)
        {
            this.attrType = attrType;
            this.attrValues = attrValues;
        }
开发者ID:woutersmit,项目名称:NBitcoin,代码行数:7,代码来源:Attribute.cs


示例4: AuthEnvelopedData

        public AuthEnvelopedData(
            OriginatorInfo			originatorInfo,
            Asn1Set					recipientInfos,
            EncryptedContentInfo	authEncryptedContentInfo,
            Asn1Set					authAttrs,
            Asn1OctetString			mac,
            Asn1Set					unauthAttrs)
        {
            // "It MUST be set to 0."
            this.version = new DerInteger(0);

            this.originatorInfo = originatorInfo;

            // TODO
            // "There MUST be at least one element in the collection."
            this.recipientInfos = recipientInfos;

            this.authEncryptedContentInfo = authEncryptedContentInfo;

            // TODO
            // "The authAttrs MUST be present if the content type carried in
            // EncryptedContentInfo is not id-data."
            this.authAttrs = authAttrs;

            this.mac = mac;

            this.unauthAttrs = unauthAttrs;
        }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:28,代码来源:AuthEnvelopedData.cs


示例5: AuthenticatedData

		public AuthenticatedData(
			OriginatorInfo		originatorInfo,
			Asn1Set				recipientInfos,
			AlgorithmIdentifier	macAlgorithm,
			AlgorithmIdentifier	digestAlgorithm,
			ContentInfo			encapsulatedContent,
			Asn1Set				authAttrs,
			Asn1OctetString		mac,
			Asn1Set				unauthAttrs)
		{
			if (digestAlgorithm != null || authAttrs != null)
			{
				if (digestAlgorithm == null || authAttrs == null)
				{
					throw new ArgumentException("digestAlgorithm and authAttrs must be set together");
				}
			}

			version = new DerInteger(CalculateVersion(originatorInfo));

			this.originatorInfo = originatorInfo;
			this.macAlgorithm = macAlgorithm;
			this.digestAlgorithm = digestAlgorithm;
			this.recipientInfos = recipientInfos;
			this.encapsulatedContentInfo = encapsulatedContent;
			this.authAttrs = authAttrs;
			this.mac = mac;
			this.unauthAttrs = unauthAttrs;
		}
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:29,代码来源:AuthenticatedData.cs


示例6: AttributePkcs

        private AttributePkcs(
            Asn1Sequence seq)
        {
            if (seq.Count != 2)
                throw new ArgumentException("Wrong number of elements in sequence", "seq");

            attrType = DerObjectIdentifier.GetInstance(seq[0]);
            attrValues = Asn1Set.GetInstance(seq[1]);
        }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:9,代码来源:Attribute.cs


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


示例8: AttributeTable

        public AttributeTable(Asn1Set s)
        {
            _attributes = Platform.CreateHashtable(s.Count);

            for (int i = 0; i != s.Count; i++)
            {
                Attribute a = Attribute.GetInstance(s[i]);

                AddAttribute(a);
            }
        }
开发者ID:Xanagandr,项目名称:DisaOpenSource,代码行数:11,代码来源:AttributeTable.cs


示例9: EncryptedData

        public EncryptedData(
            EncryptedContentInfo	encInfo,
            Asn1Set					unprotectedAttrs)
        {
            if (encInfo == null)
                throw new ArgumentNullException("encInfo");

            this.version = new DerInteger((unprotectedAttrs == null) ? 0 : 2);
            this.encryptedContentInfo = encInfo;
            this.unprotectedAttrs = unprotectedAttrs;
        }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:11,代码来源:EncryptedData.cs


示例10: EnvelopedData

 public EnvelopedData(
     OriginatorInfo originatorInfo,
     Asn1Set recipientInfos,
     EncryptedContentInfo encryptedContentInfo,
     Attributes unprotectedAttrs)
 {
     this.version = new DerInteger(CalculateVersion(originatorInfo, recipientInfos, Asn1Set.GetInstance(unprotectedAttrs)));
     this.originatorInfo = originatorInfo;
     this.recipientInfos = recipientInfos;
     this.encryptedContentInfo = encryptedContentInfo;
     this.unprotectedAttrs = Asn1Set.GetInstance(unprotectedAttrs);
 }
开发者ID:woutersmit,项目名称:NBitcoin,代码行数:12,代码来源:EnvelopedData.cs


示例11: checkSortedSet

		private void checkSortedSet(
			int		attempt,
			Asn1Set	s)
		{
			if (s[0] is DerBoolean
				&& s[1] is DerInteger
				&& s[2] is DerBitString
				&& s[3] is DerOctetString)
			{
				return;
			}

			Fail("sorting failed on attempt: " + attempt);
		}
开发者ID:randombit,项目名称:hacrypto,代码行数:14,代码来源:SetTest.cs


示例12: CertificationRequestInfo

		public CertificationRequestInfo(
            X509Name				subject,
            SubjectPublicKeyInfo	pkInfo,
            Asn1Set					attributes)
        {
            this.subject = subject;
            this.subjectPKInfo = pkInfo;
            this.attributes = attributes;

			if (subject == null || version == null || subjectPKInfo == null)
            {
                throw new ArgumentException(
					"Not all mandatory fields set in CertificationRequestInfo generator.");
            }
        }
开发者ID:MBrekhof,项目名称:pleiobox-clients,代码行数:15,代码来源:CertificationRequestInfo.cs


示例13: SignedData

 public SignedData(
     DerInteger        _version,
     Asn1Set           _digestAlgorithms,
     ContentInfo       _contentInfo,
     Asn1Set           _certificates,
     Asn1Set           _crls,
     Asn1Set           _signerInfos)
 {
     version          = _version;
     digestAlgorithms = _digestAlgorithms;
     contentInfo      = _contentInfo;
     certificates     = _certificates;
     crls             = _crls;
     signerInfos      = _signerInfos;
 }
开发者ID:woutersmit,项目名称:NBitcoin,代码行数:15,代码来源:SignedData.cs


示例14: SignerInfo

 public SignerInfo(
     SignerIdentifier        sid,
     AlgorithmIdentifier     digAlgorithm,
     Attributes              authenticatedAttributes,
     AlgorithmIdentifier     digEncryptionAlgorithm,
     Asn1OctetString         encryptedDigest,
     Attributes              unauthenticatedAttributes)
 {
     this.version = new DerInteger(sid.IsTagged ? 3 : 1);
     this.sid = sid;
     this.digAlgorithm = digAlgorithm;
     this.authenticatedAttributes = Asn1Set.GetInstance(authenticatedAttributes);
     this.digEncryptionAlgorithm = digEncryptionAlgorithm;
     this.encryptedDigest = encryptedDigest;
     this.unauthenticatedAttributes = Asn1Set.GetInstance(unauthenticatedAttributes);
 }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:16,代码来源:SignerInfo.cs


示例15: SignedData

 public SignedData(
     Asn1Set     digestAlgorithms,
     ContentInfo contentInfo,
     Asn1Set     certificates,
     Asn1Set     crls,
     Asn1Set     signerInfos)
 {
     this.version = CalculateVersion(contentInfo.ContentType, certificates, crls, signerInfos);
     this.digestAlgorithms = digestAlgorithms;
     this.contentInfo = contentInfo;
     this.certificates = certificates;
     this.crls = crls;
     this.signerInfos = signerInfos;
     this.crlsBer = crls is BerSet;
     this.certsBer = certificates is BerSet;
 }
开发者ID:bitcoinkit,项目名称:BitcoinKit-CSharp,代码行数:16,代码来源:SignedData.cs


示例16: SignerInfo

		public SignerInfo(
            DerInteger              version,
            IssuerAndSerialNumber   issuerAndSerialNumber,
            AlgorithmIdentifier     digAlgorithm,
            Asn1Set                 authenticatedAttributes,
            AlgorithmIdentifier     digEncryptionAlgorithm,
            Asn1OctetString         encryptedDigest,
            Asn1Set                 unauthenticatedAttributes)
        {
            this.version = version;
            this.issuerAndSerialNumber = issuerAndSerialNumber;
            this.digAlgorithm = digAlgorithm;
            this.authenticatedAttributes = authenticatedAttributes;
            this.digEncryptionAlgorithm = digEncryptionAlgorithm;
            this.encryptedDigest = encryptedDigest;
            this.unauthenticatedAttributes = unauthenticatedAttributes;
        }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:17,代码来源:SignerInfo.cs


示例17: AuthenticatedData

	    private AuthenticatedData(
	        Asn1Sequence seq)
	    {
	        int index = 0;

	        version = (DerInteger)seq[index++];

	        Asn1Encodable tmp = seq[index++];

	        if (tmp is Asn1TaggedObject)
	        {
	            originatorInfo = OriginatorInfo.GetInstance((Asn1TaggedObject)tmp, false);
	            tmp = seq[index++];
	        }

	        recipientInfos = Asn1Set.GetInstance(tmp);
	        macAlgorithm = AlgorithmIdentifier.GetInstance(seq[index++]);

	        tmp = seq[index++];

	        if (tmp is Asn1TaggedObject)
	        {
	            digestAlgorithm = AlgorithmIdentifier.GetInstance((Asn1TaggedObject)tmp, false);
	            tmp = seq[index++];
	        }

	        encapsulatedContentInfo = ContentInfo.GetInstance(tmp);

	        tmp = seq[index++];

	        if (tmp is Asn1TaggedObject)
	        {
	            authAttrs = Asn1Set.GetInstance((Asn1TaggedObject)tmp, false);
	            tmp = seq[index++];
	        }

	        mac = Asn1OctetString.GetInstance(tmp);
	        
	        if (seq.Count > index)
	        {
	            unauthAttrs = Asn1Set.GetInstance((Asn1TaggedObject)seq[index], false);
	        }
	    }
开发者ID:nicecai,项目名称:iTextSharp-4.1.6,代码行数:43,代码来源:AuthenticatedData.cs


示例18: SafeBag

		public SafeBag(
            DerObjectIdentifier	oid,
            Asn1Object			obj)
        {
            this.bagID = oid;
            this.bagValue = obj;
            this.bagAttributes = null;
        }
开发者ID:woutersmit,项目名称:NBitcoin,代码行数:8,代码来源:SafeBag.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Asn1TaggedObject类代码示例发布时间:2022-05-24
下一篇:
C# Asn1SequenceOf类代码示例发布时间: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