Click here to Skip to main content
15,895,799 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.4K   2K   59  
A utility for generating user editable reports, charts, documents, enquiries
using System;
using System.Collections;

using Org.BouncyCastle.Asn1;

namespace Org.BouncyCastle.Asn1.X509
{
    /**
     * The AuthorityInformationAccess object.
     * <pre>
     * id-pe-authorityInfoAccess OBJECT IDENTIFIER ::= { id-pe 1 }
     *
     * AuthorityInfoAccessSyntax  ::=
     *      Sequence SIZE (1..MAX) OF AccessDescription
     * AccessDescription  ::=  Sequence {
     *       accessMethod          OBJECT IDENTIFIER,
     *       accessLocation        GeneralName  }
     *
     * id-ad OBJECT IDENTIFIER ::= { id-pkix 48 }
     * id-ad-caIssuers OBJECT IDENTIFIER ::= { id-ad 2 }
     * id-ad-ocsp OBJECT IDENTIFIER ::= { id-ad 1 }
     * </pre>
     */
    public class AuthorityInformationAccess
        : Asn1Encodable
    {
        internal readonly DerObjectIdentifier	accessMethod;
        internal readonly GeneralName			accessLocation;

		public static AuthorityInformationAccess GetInstance(
            object obj)
        {
            if (obj is AuthorityInformationAccess)
            {
                return (AuthorityInformationAccess) obj;
            }

			if (obj is Asn1Sequence)
			{
				return new AuthorityInformationAccess((Asn1Sequence) obj);
			}

			if (obj is X509Extension)
			{
				return GetInstance(X509Extension.ConvertValueToObject((X509Extension) obj));
			}

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

		private AuthorityInformationAccess(
            Asn1Sequence seq)
        {
			foreach (DerSequence vec in seq)
			{
                if (vec.Count != 2)
                {
                    throw new ArgumentException("wrong number of elements in inner sequence");
                }

				accessMethod = (DerObjectIdentifier) vec[0];
                accessLocation = (GeneralName) vec[1];
            }
        }

		/**
         * create an AuthorityInformationAccess with the oid and location provided.
         */
        public AuthorityInformationAccess(
            DerObjectIdentifier	oid,
            GeneralName			location)
        {
            accessMethod = oid;
            accessLocation = location;
        }

		public override Asn1Object ToAsn1Object()
        {
            return new DerSequence(new DerSequence(accessMethod, accessLocation));
        }

		public override string ToString()
        {
            return ("AuthorityInformationAccess: Oid(" + this.accessMethod.Id + ")");
        }
    }
}

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