Inheritance: Asn1Encodable
Esempio n. 1
0
		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
			}
		}
Esempio n. 2
0
		private void checkValues(
			Admissions		admissions,
			GeneralName		name,
			NamingAuthority	auth)
		{
			checkMandatoryField("admissionAuthority", name, admissions.AdmissionAuthority);
			checkMandatoryField("namingAuthority", auth, admissions.NamingAuthority);
		}
Esempio n. 3
0
 public virtual Admissions[] GetContentsOfAdmissions()
 {
     Admissions[] array = new Admissions[this.contentsOfAdmissions.Count];
     for (int i = 0; i < this.contentsOfAdmissions.Count; i++)
     {
         array[i] = Admissions.GetInstance(this.contentsOfAdmissions[i]);
     }
     return(array);
 }
Esempio n. 4
0
        /**
         * @return Returns the contentsOfAdmissions.
         */
        public virtual Admissions[] GetContentsOfAdmissions()
        {
            Admissions[] result = new Admissions[contentsOfAdmissions.Count];

            for (int i = 0; i < contentsOfAdmissions.Count; ++i)
            {
                result[i] = Admissions.GetInstance(contentsOfAdmissions[i]);
            }

            return(result);
        }
Esempio n. 5
0
		private void checkConstruction(
			Admissions      admissions,
			GeneralName     name,
			NamingAuthority auth)
		{
			checkValues(admissions, name, auth);

			admissions = Admissions.GetInstance(admissions);

			checkValues(admissions, name, auth);

			Asn1InputStream aIn = new Asn1InputStream(admissions.ToAsn1Object().GetEncoded());

			Asn1Sequence info = (Asn1Sequence)aIn.ReadObject();

			admissions = Admissions.GetInstance(info);

			checkValues(admissions, name, auth);
		}
		/**
		* @return Returns the contentsOfAdmissions.
		*/
		public virtual Admissions[] GetContentsOfAdmissions()
		{
			Admissions[] result = new Admissions[contentsOfAdmissions.Count];

			for (int i = 0; i < contentsOfAdmissions.Count; ++i)
			{
				result[i] = Admissions.GetInstance(contentsOfAdmissions[i]);
			}

			return result;
		}