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


C# Asn1.Asn1Sequence类代码示例

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


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

示例1: CompressedData

		public CompressedData(
            Asn1Sequence seq)
        {
            this.version = (DerInteger) seq[0];
            this.compressionAlgorithm = AlgorithmIdentifier.GetInstance(seq[1]);
            this.encapContentInfo = ContentInfo.GetInstance(seq[2]);
        }
开发者ID:MBrekhof,项目名称:pleiobox-clients,代码行数:7,代码来源:CompressedData.cs

示例2: LdsSecurityObject

		private LdsSecurityObject(
			Asn1Sequence seq)
		{
			if (seq == null || seq.Count == 0)
				throw new ArgumentException("null or empty sequence passed.");

			IEnumerator e = seq.GetEnumerator();

			// version
			e.MoveNext();
			version = DerInteger.GetInstance(e.Current);
			// digestAlgorithmIdentifier
			e.MoveNext();
			digestAlgorithmIdentifier = AlgorithmIdentifier.GetInstance(e.Current);

			e.MoveNext();
			Asn1Sequence datagroupHashSeq = Asn1Sequence.GetInstance(e.Current);

			if (version.Value.Equals(BigInteger.One))
			{
				e.MoveNext();
				versionInfo = LdsVersionInfo.GetInstance(e.Current);
			}

			CheckDatagroupHashSeqSize(datagroupHashSeq.Count);

			datagroupHash = new DataGroupHash[datagroupHashSeq.Count];
			for (int i= 0; i< datagroupHashSeq.Count; i++)
			{
				datagroupHash[i] = DataGroupHash.GetInstance(datagroupHashSeq[i]);
			}
		}
开发者ID:MBrekhof,项目名称:pleiobox-clients,代码行数:32,代码来源:LDSSecurityObject.cs

示例3: SignerLocation

		public SignerLocation(
			DerUtf8String	countryName,
			DerUtf8String	localityName,
			Asn1Sequence	postalAddress)
		{
			if (postalAddress != null && postalAddress.Count > 6)
			{
				throw new ArgumentException("postal address must contain less than 6 strings");
			}

			if (countryName != null)
			{
				this.countryName = DerUtf8String.GetInstance(countryName.ToAsn1Object());
			}

			if (localityName != null)
			{
				this.localityName = DerUtf8String.GetInstance(localityName.ToAsn1Object());
			}

			if (postalAddress != null)
			{
				this.postalAddress = (Asn1Sequence) postalAddress.ToAsn1Object();
			}
		}
开发者ID:MBrekhof,项目名称:pleiobox-clients,代码行数:25,代码来源:SignerLocation.cs

示例4: SignerLocation

        public SignerLocation(
			Asn1Sequence seq)
        {
            foreach (DerTaggedObject o in seq)
            {
                switch (o.TagNo)
                {
                    case 0:
                        this.countryName = DerUtf8String.GetInstance(o, true);
                        break;
                    case 1:
                        this.localityName = DerUtf8String.GetInstance(o, true);
                        break;
                    case 2:
                        bool isExplicit = o.IsExplicit();	// handle erroneous implicitly tagged sequences
                        this.postalAddress = Asn1Sequence.GetInstance(o, isExplicit);
                        if (postalAddress != null && postalAddress.Count > 6)
                        {
                            throw new ArgumentException("postal address must contain less than 6 strings");
                        }
                        break;
                    default:
                        throw new ArgumentException("illegal tag");
                }
            }
        }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:26,代码来源:SignerLocation.cs

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

示例6: SemanticsInformation

        public SemanticsInformation(
			Asn1Sequence seq)
        {
            if (seq.Count < 1)
            {
                throw new ArgumentException("no objects in SemanticsInformation");
            }

            IEnumerator e = seq.GetEnumerator();
            e.MoveNext();
            object obj = e.Current;
            if (obj is DerObjectIdentifier)
            {
                semanticsIdentifier = DerObjectIdentifier.GetInstance(obj);
                if (e.MoveNext())
                {
                    obj  = e.Current;
                }
                else
                {
                    obj  = null;
                }
            }

            if (obj  != null)
            {
                Asn1Sequence generalNameSeq = Asn1Sequence.GetInstance(obj );
                nameRegistrationAuthorities = new GeneralName[generalNameSeq.Count];
                for (int i= 0; i < generalNameSeq.Count; i++)
                {
                    nameRegistrationAuthorities[i] = GeneralName.GetInstance(generalNameSeq[i]);
                }
            }
        }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:34,代码来源:SemanticsInformation.cs

示例7: AttributeCertificateInfo

		private AttributeCertificateInfo(
            Asn1Sequence seq)
        {
			if (seq.Count < 7 || seq.Count > 9)
			{
				throw new ArgumentException("Bad sequence size: " + seq.Count);
			}

			this.version = DerInteger.GetInstance(seq[0]);
            this.holder = Holder.GetInstance(seq[1]);
            this.issuer = AttCertIssuer.GetInstance(seq[2]);
            this.signature = AlgorithmIdentifier.GetInstance(seq[3]);
            this.serialNumber = DerInteger.GetInstance(seq[4]);
            this.attrCertValidityPeriod = AttCertValidityPeriod.GetInstance(seq[5]);
            this.attributes = Asn1Sequence.GetInstance(seq[6]);

			for (int i = 7; i < seq.Count; i++)
            {
                Asn1Encodable obj = (Asn1Encodable) seq[i];

				if (obj is DerBitString)
                {
                    this.issuerUniqueID = DerBitString.GetInstance(seq[i]);
                }
                else if (obj is Asn1Sequence || obj is X509Extensions)
                {
                    this.extensions = X509Extensions.GetInstance(seq[i]);
                }
            }
        }
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:30,代码来源:AttributeCertificateInfo.cs

示例8: RecipientKeyIdentifier

        public RecipientKeyIdentifier(
            Asn1Sequence seq)
        {
            subjectKeyIdentifier = Asn1OctetString.GetInstance(
                seq[0]);

            switch(seq.Count)
            {
                case 1:
                    break;
                case 2:
                    if (seq[1] is DerGeneralizedTime)
                    {
                        date = (DerGeneralizedTime) seq[1];
                    }
                    else
                    {
                        other = OtherKeyAttribute.GetInstance(seq[2]);
                    }
                    break;
                case 3:
                    date  = (DerGeneralizedTime) seq[1];
                    other = OtherKeyAttribute.GetInstance(seq[2]);
                    break;
                default:
                    throw new ArgumentException("Invalid RecipientKeyIdentifier");
            }
        }
开发者ID:karino2,项目名称:wikipediaconv,代码行数:28,代码来源:RecipientKeyIdentifier.cs

示例9: CheckPermittedDN

        private void CheckPermittedDN(ISet permitted, Asn1Sequence dns)
        //throws PkixNameConstraintValidatorException
        {
            if (permitted == null)
            {
                return;
            }

            if ((permitted.Count == 0) && dns.Count == 0)
            {
                return;
            }

            IEnumerator it = permitted.GetEnumerator();

            while (it.MoveNext())
            {
                Asn1Sequence subtree = (Asn1Sequence)it.Current;

                if (WithinDNSubtree(dns, subtree))
                {
                    return;
                }
            }

            throw new PkixNameConstraintValidatorException(
                "Subject distinguished name is not from a permitted subtree");
        }
开发者ID:MBrekhof,项目名称:pleiobox-clients,代码行数:28,代码来源:PkixNameConstraintValidator.cs

示例10: SingleResponse

		public SingleResponse(
            Asn1Sequence seq)
        {
            this.certID = CertID.GetInstance(seq[0]);
            this.certStatus = CertStatus.GetInstance(seq[1]);
            this.thisUpdate = (DerGeneralizedTime)seq[2];

			if (seq.Count > 4)
            {
                this.nextUpdate = DerGeneralizedTime.GetInstance(
					(Asn1TaggedObject) seq[3], true);
                this.singleExtensions = X509Extensions.GetInstance(
					(Asn1TaggedObject) seq[4], true);
            }
            else if (seq.Count > 3)
            {
                Asn1TaggedObject o = (Asn1TaggedObject) seq[3];

				if (o.TagNo == 0)
                {
                    this.nextUpdate = DerGeneralizedTime.GetInstance(o, true);
                }
                else
                {
                    this.singleExtensions = X509Extensions.GetInstance(o, true);
                }
            }
        }
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:28,代码来源:SingleResponse.cs

示例11: EncryptionScheme

        internal EncryptionScheme(
			Asn1Sequence seq)
            : base(seq)
        {
            objectID = (Asn1Object) seq[0];
            obj = (Asn1Object) seq[1];
        }
开发者ID:Noyabronok,项目名称:itextsharpml,代码行数:7,代码来源:EncryptionScheme.cs

示例12: CommitmentTypeIndication

 public CommitmentTypeIndication(
     DerObjectIdentifier	commitmentTypeId,
     Asn1Sequence		commitmentTypeQualifier)
 {
     this.commitmentTypeId = commitmentTypeId;
     this.commitmentTypeQualifier = commitmentTypeQualifier;
 }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:7,代码来源:CommitmentTypeIndication.cs

示例13: IdeaCbcPar

		private IdeaCbcPar(
            Asn1Sequence seq)
        {
			if (seq.Count == 1)
			{
				iv = (Asn1OctetString) seq[0];
			}
        }
开发者ID:nicecai,项目名称:iTextSharp-4.1.6,代码行数:8,代码来源:IDEACBCPar.cs

示例14: KekRecipientInfo

		public KekRecipientInfo(
            Asn1Sequence seq)
        {
            version = (DerInteger) seq[0];
            kekID = KekIdentifier.GetInstance(seq[1]);
            keyEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq[2]);
            encryptedKey = (Asn1OctetString) seq[3];
        }
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:8,代码来源:KEKRecipientInfo.cs

示例15: KeyTransRecipientInfo

		public KeyTransRecipientInfo(
            Asn1Sequence seq)
        {
            this.version = (DerInteger) seq[0];
            this.rid = RecipientIdentifier.GetInstance(seq[1]);
            this.keyEncryptionAlgorithm = AlgorithmIdentifier.GetInstance(seq[2]);
            this.encryptedKey = (Asn1OctetString) seq[3];
        }
开发者ID:htlp,项目名称:itextsharp,代码行数:8,代码来源:KeyTransRecipientInfo.cs


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