Click here to Skip to main content
15,885,216 members
Articles / Programming Languages / Visual Basic

Open Door - Reporting, Charts, Enquiry Drill-Downs

Rate me:
Please Sign up or sign in to vote.
4.37/5 (11 votes)
2 Feb 2009CPOL6 min read 39.2K   2K   59  
A utility for generating user editable reports, charts, documents, enquiries
using System;

namespace Org.BouncyCastle.Asn1.Esf
{
	/// <remarks>
	/// RFC 3126: 4.3.2 Revocation Values Attribute Definition
	/// <code>
	/// OtherRevVals ::= SEQUENCE 
	/// {
	///		otherRevValType      OtherRevValType,
	///		otherRevVals         ANY DEFINED BY otherRevValType
	/// }
	///
	/// OtherRevValType ::= OBJECT IDENTIFIER
	/// </code>
	/// </remarks>
	public class OtherRevVals
		: Asn1Encodable
	{
		private readonly DerObjectIdentifier	otherRevValType;
		private readonly Asn1Object				otherRevVals;

		public static OtherRevVals GetInstance(
			object obj)
		{
			if (obj == null || obj is OtherRevVals)
				return (OtherRevVals) obj;

			if (obj is Asn1Sequence)
				return new OtherRevVals((Asn1Sequence) obj);

			throw new ArgumentException(
				"Unknown object in 'OtherRevVals' factory: "
					+ obj.GetType().Name,
				"obj");
		}

		private OtherRevVals(
			Asn1Sequence seq)
		{
			if (seq == null)
				throw new ArgumentNullException("seq");
			if (seq.Count != 2)
				throw new ArgumentException("Bad sequence size: " + seq.Count, "seq");

			this.otherRevValType = (DerObjectIdentifier) seq[0].ToAsn1Object();
			this.otherRevVals = seq[1].ToAsn1Object();
		}

		public OtherRevVals(
			DerObjectIdentifier	otherRevValType,
			Asn1Encodable		otherRevVals)
		{
			if (otherRevValType == null)
				throw new ArgumentNullException("otherRevValType");
			if (otherRevVals == null)
				throw new ArgumentNullException("otherRevVals");

			this.otherRevValType = otherRevValType;
			this.otherRevVals = otherRevVals.ToAsn1Object();
		}

		public DerObjectIdentifier OtherRevValType
		{
			get { return otherRevValType; }
		}

		public Asn1Object OtherRevValsObject
		{
			get { return otherRevVals; }
		}

		public override Asn1Object ToAsn1Object()
		{
			return new DerSequence(otherRevValType, otherRevVals);
		}
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions