Org.BouncyCastle.Asn1.IsisMtt.X509.ProcurationSyntax.ToAsn1Object C# (CSharp) Method

ToAsn1Object() public method

public ToAsn1Object ( ) : Asn1Object
return Asn1Object
		public override Asn1Object ToAsn1Object()
		{
			Asn1EncodableVector vec = new Asn1EncodableVector();
			if (country != null)
			{
				vec.Add(new DerTaggedObject(true, 1, new DerPrintableString(country, true)));
			}
			if (typeOfSubstitution != null)
			{
				vec.Add(new DerTaggedObject(true, 2, typeOfSubstitution));
			}
			if (thirdPerson != null)
			{
				vec.Add(new DerTaggedObject(true, 3, thirdPerson));
			}
			else
			{
				vec.Add(new DerTaggedObject(true, 3, certRef));
			}

			return new DerSequence(vec);
		}
	}

Usage Example

		private void checkConstruction(
			ProcurationSyntax	procuration,
			string				country,
			DirectoryString		typeOfSubstitution,
			GeneralName			thirdPerson,
			IssuerSerial		certRef)
		{
			checkValues(procuration, country, typeOfSubstitution, thirdPerson, certRef);

			procuration = ProcurationSyntax.GetInstance(procuration);

			checkValues(procuration, country, typeOfSubstitution, thirdPerson, certRef);

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

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

			procuration = ProcurationSyntax.GetInstance(seq);

			checkValues(procuration, country, typeOfSubstitution, thirdPerson, certRef);
		}