コード例 #1
0
        /// <summary>
        /// Checks if the certificate is activated
        /// </summary>
        /// <param name="certificate">The certificate to check</param>
        /// <returns>boolean stating whether the certificate is activated (true) or not (false)</returns>
        /// <exception cref="CheckCertificateActivatedUnexpectedException">This exception is thrown, if an unexpected exception is thrown during the method</exception>
        public bool CheckCertificateActivated(X509Certificate2 certificate)
        {
            bool isActive = false;

            try {
                CertificateValidator.CheckCertificateActivated(certificate);
                isActive = true;
            } catch (CertificateNotActiveException) {
                isActive = false;
            } catch (ArgumentNullException) {
                throw;
            } catch (CryptographicUnexpectedOperationException) {
                throw;
            } catch (CryptographicException) {
                throw;
            } catch (Exception e) {
                throw new CheckCertificateActivatedUnexpectedException(e);
            }
            return(isActive);
        }