/**
		* Find the issuer certificates of a given certificate.
		*
		* @param cert
		*            The certificate for which an issuer should be found.
		* @param pkixParams
		* @return A <code>Collection</code> object containing the issuer
		*         <code>X509Certificate</code>s. Never <code>null</code>.
		*
		* @exception Exception
		*                if an error occurs.
		*/
		internal static ICollection FindIssuerCerts(
			X509Certificate			cert,
			PkixBuilderParameters	pkixParams)
		{
			X509CertStoreSelector certSelect = new X509CertStoreSelector();
			ISet certs = new HashSet();
			try
			{
				certSelect.Subject = cert.IssuerDN;
			}
			catch (IOException ex)
			{
				throw new Exception(
					"Subject criteria for certificate selector to find issuer certificate could not be set.", ex);
			}

			try
			{
                certs.AddAll(PkixCertPathValidatorUtilities.FindCertificates(certSelect, pkixParams.GetStores()));
                certs.AddAll(PkixCertPathValidatorUtilities.FindCertificates(certSelect, pkixParams.GetAdditionalStores()));
			}
			catch (Exception e)
			{
				throw new Exception("Issuer certificate cannot be searched.", e);
			}

			return certs;
		}
Beispiel #2
0
        internal static global::System.Collections.ICollection FindIssuerCerts(X509Certificate cert, PkixBuilderParameters pkixParams)
        {
            //IL_001b: Expected O, but got Unknown
            X509CertStoreSelector x509CertStoreSelector = new X509CertStoreSelector();
            ISet set = new HashSet();

            try
            {
                x509CertStoreSelector.Subject = cert.IssuerDN;
            }
            catch (IOException val)
            {
                IOException val2 = val;
                throw new global::System.Exception("Subject criteria for certificate selector to find issuer certificate could not be set.", (global::System.Exception)(object) val2);
            }
            try
            {
                set.AddAll((global::System.Collections.IEnumerable)FindCertificates(x509CertStoreSelector, pkixParams.GetStores()));
                set.AddAll((global::System.Collections.IEnumerable)FindCertificates(x509CertStoreSelector, pkixParams.GetAdditionalStores()));
                return(set);
            }
            catch (global::System.Exception ex)
            {
                throw new global::System.Exception("Issuer certificate cannot be searched.", ex);
            }
        }
Beispiel #3
0
        /**
         * Find the issuer certificates of a given certificate.
         *
         * @param cert
         *            The certificate for which an issuer should be found.
         * @param pkixParams
         * @return A <code>Collection</code> object containing the issuer
         *         <code>X509Certificate</code>s. Never <code>null</code>.
         *
         * @exception Exception
         *                if an error occurs.
         */
        internal static ICollection FindIssuerCerts(
            X509Certificate cert,
            PkixBuilderParameters pkixParams)
        {
            X509CertStoreSelector certSelect = new X509CertStoreSelector();
            ISet certs = new HashSet();

            try
            {
                certSelect.Subject = cert.IssuerDN;
            }
            catch (IOException ex)
            {
                throw new Exception(
                          "Subject criteria for certificate selector to find issuer certificate could not be set.", ex);
            }

            try
            {
                certs.AddAll(PkixCertPathValidatorUtilities.FindCertificates(certSelect, pkixParams.GetStores()));
                certs.AddAll(PkixCertPathValidatorUtilities.FindCertificates(certSelect, pkixParams.GetAdditionalStores()));
            }
            catch (Exception e)
            {
                throw new Exception("Issuer certificate cannot be searched.", e);
            }

            return(certs);
        }
Beispiel #4
0
        internal static ICollection FindIssuerCerts(X509Certificate cert, PkixBuilderParameters pkixParams)
        {
            X509CertStoreSelector x509CertStoreSelector = new X509CertStoreSelector();
            ISet set = new HashSet();

            try
            {
                x509CertStoreSelector.Subject = cert.IssuerDN;
            }
            catch (IOException innerException)
            {
                throw new Exception("Subject criteria for certificate selector to find issuer certificate could not be set.", innerException);
            }
            try
            {
                set.AddAll(PkixCertPathValidatorUtilities.FindCertificates(x509CertStoreSelector, pkixParams.GetStores()));
                set.AddAll(PkixCertPathValidatorUtilities.FindCertificates(x509CertStoreSelector, pkixParams.GetAdditionalStores()));
            }
            catch (Exception innerException2)
            {
                throw new Exception("Issuer certificate cannot be searched.", innerException2);
            }
            return(set);
        }