當前位置: 首頁>>代碼示例>>C#>>正文


C# Asn1.Asn1Set類代碼示例

本文整理匯總了C#中Org.BouncyCastle.Asn1.Asn1Set的典型用法代碼示例。如果您正苦於以下問題:C# Asn1Set類的具體用法?C# Asn1Set怎麽用?C# Asn1Set使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Asn1Set類屬於Org.BouncyCastle.Asn1命名空間,在下文中一共展示了Asn1Set類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: 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:nicecai,項目名稱:iTextSharp-4.1.6,代碼行數:29,代碼來源:OriginatorInfo.cs

示例2: CmsAuthEnvelopedData

		public CmsAuthEnvelopedData(
			ContentInfo contentInfo)
		{
			this.contentInfo = contentInfo;

			AuthEnvelopedData authEnvData = AuthEnvelopedData.GetInstance(contentInfo.Content);

			this.originator = authEnvData.OriginatorInfo;

			//
	        // read the recipients
	        //
	        Asn1Set recipientInfos = authEnvData.RecipientInfos;

			//
			// read the auth-encrypted content info
			//
			EncryptedContentInfo authEncInfo = authEnvData.AuthEncryptedContentInfo;
			this.authEncAlg = authEncInfo.ContentEncryptionAlgorithm;
			CmsSecureReadable secureReadable = new AuthEnvelopedSecureReadable(this);

			//
			// build the RecipientInformationStore
			//
			this.recipientInfoStore = CmsEnvelopedHelper.BuildRecipientInformationStore(
				recipientInfos, secureReadable);

			// FIXME These need to be passed to the AEAD cipher as AAD (Additional Authenticated Data)
			this.authAttrs = authEnvData.AuthAttrs;
			this.mac = authEnvData.Mac.GetOctets();
			this.unauthAttrs = authEnvData.UnauthAttrs;
		}
開發者ID:MBrekhof,項目名稱:pleiobox-clients,代碼行數:32,代碼來源:CMSAuthEnvelopedData.cs

示例3: EnvelopedData

		public EnvelopedData(
            OriginatorInfo			originatorInfo,
            Asn1Set					recipientInfos,
            EncryptedContentInfo	encryptedContentInfo,
            Asn1Set					unprotectedAttrs)
        {
            if (originatorInfo != null || unprotectedAttrs != null)
            {
                version = new DerInteger(2);
            }
            else
            {
                version = new DerInteger(0);

				foreach (object o in recipientInfos)
				{
                    RecipientInfo ri = RecipientInfo.GetInstance(o);

					if (!ri.Version.Equals(version))
                    {
                        version = new DerInteger(2);
                        break;
                    }
                }
            }

			this.originatorInfo = originatorInfo;
            this.recipientInfos = recipientInfos;
            this.encryptedContentInfo = encryptedContentInfo;
            this.unprotectedAttrs = unprotectedAttrs;
        }
開發者ID:ktw,項目名稱:OutlookPrivacyPlugin,代碼行數:31,代碼來源:EnvelopedData.cs

示例4: CmsAuthenticatedData

		public CmsAuthenticatedData(
			ContentInfo contentInfo)
		{
			this.contentInfo = contentInfo;

			AuthenticatedData authData = AuthenticatedData.GetInstance(contentInfo.Content);

			//
			// read the recipients
			//
			Asn1Set recipientInfos = authData.RecipientInfos;

			this.macAlg = authData.MacAlgorithm;

			//
			// read the authenticated content info
			//
			ContentInfo encInfo = authData.EncapsulatedContentInfo;
			CmsReadable readable = new CmsProcessableByteArray(
				Asn1OctetString.GetInstance(encInfo.Content).GetOctets());
			CmsSecureReadable secureReadable = new CmsEnvelopedHelper.CmsAuthenticatedSecureReadable(
				this.macAlg, readable);

			//
			// build the RecipientInformationStore
			//
			this.recipientInfoStore = CmsEnvelopedHelper.BuildRecipientInformationStore(
				recipientInfos, secureReadable);

			this.authAttrs = authData.AuthAttrs;
			this.mac = authData.Mac.GetOctets();
			this.unauthAttrs = authData.UnauthAttrs;
		}
開發者ID:MBrekhof,項目名稱:pleiobox-clients,代碼行數:33,代碼來源:CMSAuthenticatedData.cs

示例5: AttributeX509

		public AttributeX509(
            DerObjectIdentifier	attrType,
            Asn1Set				attrValues)
        {
            this.attrType = attrType;
            this.attrValues = attrValues;
        }
開發者ID:kungfubozo,項目名稱:Bouncy-Castle-WP8,代碼行數:7,代碼來源:Attribute.cs

示例6: CmsEnvelopedData

        public CmsEnvelopedData(
            ContentInfo contentInfo)
        {
            this.contentInfo = contentInfo;

			EnvelopedData envData = EnvelopedData.GetInstance(contentInfo.Content);

			//
			// read the recipients
			//
			Asn1Set recipientInfos = envData.RecipientInfos;

			//
			// read the encrypted content info
			//
			EncryptedContentInfo encInfo = envData.EncryptedContentInfo;
			this.encAlg = encInfo.ContentEncryptionAlgorithm;
			CmsReadable readable = new CmsProcessableByteArray(encInfo.EncryptedContent.GetOctets());
			CmsSecureReadable secureReadable = new CmsEnvelopedHelper.CmsEnvelopedSecureReadable(
				this.encAlg, readable);

			//
			// build the RecipientInformationStore
			//
			this.recipientInfoStore = CmsEnvelopedHelper.BuildRecipientInformationStore(
				recipientInfos, secureReadable);

			this.unprotectedAttributes = envData.UnprotectedAttrs;
        }
開發者ID:ktw,項目名稱:OutlookPrivacyPlugin,代碼行數:29,代碼來源:CMSEnvelopedData.cs

示例7: 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:hjgode,項目名稱:iTextSharpCF,代碼行數:9,代碼來源:Attribute.cs

示例8: Pkcs10CertificationRequestDelaySigned

		public Pkcs10CertificationRequestDelaySigned(
			string					signatureAlgorithm,
			X509Name				subject,
			AsymmetricKeyParameter	publicKey,
			Asn1Set					attributes,
			AsymmetricKeyParameter	signingKey)
			: base(signatureAlgorithm, subject, publicKey, attributes, signingKey)
		{
		}
開發者ID:MBrekhof,項目名稱:pleiobox-clients,代碼行數:9,代碼來源:Pkcs10CertificationRequestDelaySigned.cs

示例9: BuildRecipientInformationStore

        internal static RecipientInformationStore BuildRecipientInformationStore(
            Asn1Set recipientInfos, CmsSecureReadable secureReadable)
        {
            IList infos = Platform.CreateArrayList();
            for (int i = 0; i != recipientInfos.Count; i++)
            {
                RecipientInfo info = RecipientInfo.GetInstance(recipientInfos[i]);

                ReadRecipientInfo(infos, info, secureReadable);
            }
            return new RecipientInformationStore(infos);
        }
開發者ID:karino2,項目名稱:wikipediaconv,代碼行數:12,代碼來源:CMSEnvelopedHelper.cs

示例10: AttributeTable

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

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

				attributes.Add(a.AttrType, a);
            }
        }
開發者ID:insthync,項目名稱:bc-csharp,代碼行數:12,代碼來源:AttributeTable.cs

示例11: AttributeTable

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

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

                AddAttribute(a);
            }
        }
開發者ID:MBrekhof,項目名稱:pleiobox-clients,代碼行數:12,代碼來源:AttributeTable.cs

示例12: 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:MBrekhof,項目名稱:pleiobox-clients,代碼行數:12,代碼來源:EnvelopedData.cs

示例13: BuildPartitionedCrlDistributionPoint

        static string BuildPartitionedCrlDistributionPoint(string partitionedCrlDistributionPoint, Asn1Set dset)
        {
            foreach (DerSequence relativeDn in dset)
            {
                var relativeDnOid = ((DerObjectIdentifier)relativeDn[0]).Id;
                var relativeDnName = (string)X509Name.RFC2253Symbols[new DerObjectIdentifier(relativeDnOid)];
                var relativeDnValue = ((DerStringBase)relativeDn[1]).GetString();

                var comma = partitionedCrlDistributionPoint.Length > 0 ? "," : "";
                partitionedCrlDistributionPoint = relativeDnName + "=" + relativeDnValue + comma + partitionedCrlDistributionPoint;
            }
            return partitionedCrlDistributionPoint;
        }
開發者ID:kiniry-supervision,項目名稱:OpenNemID,代碼行數:13,代碼來源:CrlDistributionPointsExtractor.cs

示例14: 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;
        }
開發者ID:hjgode,項目名稱:iTextSharpCF,代碼行數:14,代碼來源:SignedData.cs

示例15: 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:MBrekhof,項目名稱:pleiobox-clients,代碼行數:16,代碼來源:SignerInfo.cs


注:本文中的Org.BouncyCastle.Asn1.Asn1Set類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。