/**
 * Constructor from a given details.
 *
 * @param forward Certificates issued to this CA.
 * @param reverse Certificates issued by this CA to other CAs.
 */
 public CertificatePair(
     X509CertificateStructure	forward,
     X509CertificateStructure	reverse)
 {
     this.forward = forward;
     this.reverse = reverse;
 }
 public X509CertificateStructure[] GetCertificates()
 {
     X509CertificateStructure[] result = new X509CertificateStructure[certificates.Count];
     for (int i = 0; i < certificates.Count; ++i)
     {
         result[i] = X509CertificateStructure.GetInstance(certificates[i]);
     }
     return result;
 }
 /// <summary>
 /// Create an System.Security.Cryptography.X509Certificate from an X509Certificate Structure.
 /// </summary>
 /// <param name="x509Struct"></param>
 /// <returns>A System.Security.Cryptography.X509Certificate.</returns>
 public static SystemX509.X509Certificate ToX509Certificate(
     X509CertificateStructure x509Struct)
 {
     return new SystemX509.X509Certificate(x509Struct.GetDerEncoded());
 }
        /**
        * Constructor from Asn1Sequence.
        * <p/>
        * The sequence is of type CertificatePair:
        * <p/>
        * <pre>
        *       CertificatePair ::= SEQUENCE {
        *         forward		[0]	Certificate OPTIONAL,
        *         reverse		[1]	Certificate OPTIONAL,
        *         -- at least one of the pair shall be present -- }
        * </pre>
        *
        * @param seq The ASN.1 sequence.
        */
        private CertificatePair(
            Asn1Sequence seq)
        {
            if (seq.Count != 1 && seq.Count != 2)
            {
                throw new ArgumentException("Bad sequence size: " + seq.Count, "seq");
            }

            foreach (object obj in seq)
            {
                Asn1TaggedObject o = Asn1TaggedObject.GetInstance(obj);
                if (o.TagNo == 0)
                {
                    forward = X509CertificateStructure.GetInstance(o, true);
                }
                else if (o.TagNo == 1)
                {
                    reverse = X509CertificateStructure.GetInstance(o, true);
                }
                else
                {
                    throw new ArgumentException("Bad tag number: " + o.TagNo);
                }
            }
        }
 private static X509CertificateStructure[] CopyCertList(X509CertificateStructure[] orig)
 {
     return (X509CertificateStructure[])orig.Clone();
 }
 public CscaMasterList(
     X509CertificateStructure[] certStructs)
 {
     certList = CopyCertList(certStructs);
 }