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


C# X509.GeneralName类代码示例

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


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

示例1: GeneralSubtree

		private GeneralSubtree(
			Asn1Sequence seq)
		{
			baseName = GeneralName.GetInstance(seq[0]);

			switch (seq.Count)
			{
				case 1:
					break;
				case 2:
				{
					Asn1TaggedObject o = Asn1TaggedObject.GetInstance(seq[1]);
					switch (o.TagNo)
					{
						case 0:
							minimum = DerInteger.GetInstance(o, false);
							break;
						case 1:
							maximum = DerInteger.GetInstance(o, false);
							break;
						default:
							throw new ArgumentException("Bad tag number: " + o.TagNo);
					}
					break;
				}
				case 3:
				{
					minimum = DerInteger.GetInstance(Asn1TaggedObject.GetInstance(seq[1]));
					maximum = DerInteger.GetInstance(Asn1TaggedObject.GetInstance(seq[2]));
					break;
				}
				default:
					throw new ArgumentException("Bad sequence size: " + seq.Count);
			}
		}
开发者ID:nicecai,项目名称:iTextSharp-4.1.6,代码行数:35,代码来源:GeneralSubtree.cs

示例2: FromCertificate

		private static Asn1Sequence FromCertificate(
			X509Certificate certificate)
		{
			try
			{
				GeneralName genName = new GeneralName(
					PrincipalUtilities.GetIssuerX509Principal(certificate));

				if (certificate.Version == 3)
				{
					Asn1OctetString ext = certificate.GetExtensionValue(X509Extensions.SubjectKeyIdentifier);

					if (ext != null)
					{
						Asn1OctetString str = (Asn1OctetString) X509ExtensionUtilities.FromExtensionValue(ext);

						return (Asn1Sequence) new AuthorityKeyIdentifier(
							str.GetOctets(), new GeneralNames(genName), certificate.SerialNumber).ToAsn1Object();
					}
				}

				SubjectPublicKeyInfo info = SubjectPublicKeyInfoFactory.CreateSubjectPublicKeyInfo(
					certificate.GetPublicKey());

				return (Asn1Sequence) new AuthorityKeyIdentifier(
					info, new GeneralNames(genName), certificate.SerialNumber).ToAsn1Object();
			}
			catch (Exception e)
			{
				throw new CertificateParsingException("Exception extracting certificate details", e);
			}
		}
开发者ID:MBrekhof,项目名称:pleiobox-clients,代码行数:32,代码来源:AuthorityKeyIdentifierStructure.cs

示例3: PopoSigningKeyInput

 /** Creates a new PopoSigningKeyInput with sender name as authInfo. */
 public PopoSigningKeyInput(
     GeneralName sender,
     SubjectPublicKeyInfo spki)
 {
     this.sender = sender;
     this.publicKey = spki;
 }
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:8,代码来源:PopoSigningKeyInput.cs

示例4: PkiHeaderBuilder

		public PkiHeaderBuilder(
			int			pvno,
			GeneralName	sender,
			GeneralName	recipient)
			: this(new DerInteger(pvno), sender, recipient)
		{
		}
开发者ID:Niladri24dutta,项目名称:itextsharp,代码行数:7,代码来源:PKIHeaderBuilder.cs

示例5: AccessDescription

		/**
		 * create an AccessDescription with the oid and location provided.
		 */
		public AccessDescription(
			DerObjectIdentifier	oid,
			GeneralName			location)
		{
			accessMethod = oid;
			accessLocation = location;
		}
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:10,代码来源:AccessDescription.cs

示例6: SemanticsInformation

		public SemanticsInformation(
            DerObjectIdentifier semanticsIdentifier,
            GeneralName[] generalNames)
        {
            this.semanticsIdentifier = semanticsIdentifier;
            this.nameRegistrationAuthorities = generalNames;
        }
开发者ID:KimikoMuffin,项目名称:bc-csharp,代码行数:7,代码来源:SemanticsInformation.cs

示例7: checkExcluded

        //        throws PkixNameConstraintValidatorException
        /**
         * Check if the given GeneralName is contained in the excluded ISet.
         *
         * @param name The GeneralName.
         * @throws PkixNameConstraintValidatorException
         *          If the <code>name</code> is
         *          excluded.
         */
        public void checkExcluded(GeneralName name)
        {
            switch (name.TagNo)
            {
                case 1:
                    CheckExcludedEmail(excludedSubtreesEmail, ExtractNameAsString(name));
                    break;
                case 2:
                    checkExcludedDNS(excludedSubtreesDNS, DerIA5String.GetInstance(
                        name.Name).GetString());
                    break;
                case 4:
                    CheckExcludedDN(Asn1Sequence.GetInstance(name.Name.ToAsn1Object()));
                    break;
                case 6:
                    checkExcludedURI(excludedSubtreesURI, DerIA5String.GetInstance(
                        name.Name).GetString());
                    break;
                case 7:
                    byte[] ip = Asn1OctetString.GetInstance(name.Name).GetOctets();

                    checkExcludedIP(excludedSubtreesIP, ip);
                    break;
            }
        }
开发者ID:Noyabronok,项目名称:itextsharpml,代码行数:34,代码来源:PkixNameConstraintValidator.cs

示例8: PerformTest

		public override void PerformTest()
		{
			GeneralName name = new GeneralName(new X509Name("CN=hello world"));
			NamingAuthority auth = new NamingAuthority(new DerObjectIdentifier("1.2.3"), "url", new DirectoryString("fred"));
			Admissions admissions = new Admissions(name, auth, new ProfessionInfo[0]);

			checkConstruction(admissions, name, auth);

			admissions = Admissions.GetInstance(null);

			if (admissions != null)
			{
				Fail("null GetInstance() failed.");
			}

			try
			{
				Admissions.GetInstance(new Object());

				Fail("GetInstance() failed to detect bad object.");
			}
			catch (ArgumentException)
			{
				// expected
			}
		}
开发者ID:randombit,项目名称:hacrypto,代码行数:26,代码来源:AdmissionsUnitTest.cs

示例9: AuthorityInformationAccess

 /**
  * create an AuthorityInformationAccess with the oid and location provided.
  */
 public AuthorityInformationAccess(
     DerObjectIdentifier	oid,
     GeneralName			location)
 {
     accessMethod = oid;
     accessLocation = location;
 }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:10,代码来源:AuthorityInformationAccess.cs

示例10: checkValues

		private void checkValues(
			Admissions		admissions,
			GeneralName		name,
			NamingAuthority	auth)
		{
			checkMandatoryField("admissionAuthority", name, admissions.AdmissionAuthority);
			checkMandatoryField("namingAuthority", auth, admissions.NamingAuthority);
		}
开发者ID:randombit,项目名称:hacrypto,代码行数:8,代码来源:AdmissionsUnitTest.cs

示例11: SinglePubInfo

        private SinglePubInfo(Asn1Sequence seq)
        {
            pubMethod = DerInteger.GetInstance(seq[0]);

            if (seq.Count == 2)
            {
                pubLocation = GeneralName.GetInstance(seq[1]);
            }
        }
开发者ID:NelsonSantos,项目名称:fyiReporting-Android,代码行数:9,代码来源:SinglePubInfo.cs

示例12: Admissions

        /**
        * Constructor from a given details.
        * <p/>
        * Parameter <code>professionInfos</code> is mandatory.
        *
        * @param admissionAuthority The admission authority.
        * @param namingAuthority    The naming authority.
        * @param professionInfos    The profession infos.
        */
        public Admissions(
			GeneralName			admissionAuthority,
			NamingAuthority		namingAuthority,
			ProfessionInfo[]	professionInfos)
        {
            this.admissionAuthority = admissionAuthority;
            this.namingAuthority = namingAuthority;
            this.professionInfos = new DerSequence(professionInfos);
        }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:18,代码来源:Admissions.cs

示例13: TbsRequest

		public TbsRequest(
            GeneralName     requestorName,
            Asn1Sequence    requestList,
            X509Extensions  requestExtensions)
        {
            this.version = V1;
            this.requestorName = requestorName;
            this.requestList = requestList;
            this.requestExtensions = requestExtensions;
        }
开发者ID:ktw,项目名称:OutlookPrivacyPlugin,代码行数:10,代码来源:TBSRequest.cs

示例14: GetNames

        public GeneralName[] GetNames()
        {
            GeneralName[] names = new GeneralName[seq.Count];

            for (int i = 0; i != seq.Count; i++)
            {
                names[i] = GeneralName.GetInstance(seq[i]);
            }

            return names;
        }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:11,代码来源:GeneralNames.cs

示例15: Procuration

        /**
        * Constructor from a given details.
        * <p/>
        * <p/>
        * Either <code>generalName</code> or <code>certRef</code> MUST be
        * <code>null</code>.
        *
        * @param country            The country code whose laws apply.
        * @param typeOfSubstitution The type of procuration.
        * @param thirdPerson        The GeneralName of the person who is represented.
        * @param certRef            Reference to certificate of the person who is represented.
        */
        public Procuration(
			string			country,
			DirectoryString	typeOfSubstitution,
			GeneralName		thirdPerson,
			IssuerSerial	certRef)
        {
            this.country = new DerPrintableString(country, true);
            this.typeOfSubstitution = typeOfSubstitution;
            this.thirdPerson = thirdPerson;
            this.certRef = certRef;
        }
开发者ID:hjgode,项目名称:iTextSharpCF,代码行数:23,代码来源:Procuration.cs


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