lv.pasts.eme.cert

## Class CertValidatorException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - lv.pasts.eme.cert.CertValidatorException

- All Implemented Interfaces:
    Serializable

      public class CertValidatorException
      extends Exception

  This exception is thrown when a certificate validation fails.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `REASON_CERT_EXPIRED` Certificate has expired.
    `static int` | `REASON_CERT_NOT_YET_VALID` Certificate is not yet valid.
    `static int` | `REASON_CERT_STATUS_REVOKED` Certificate is revoked.
    `static int` | `REASON_CERT_STATUS_UNKNOWN` Certificate status is unknown.
    `static int` | `REASON_CERT_STATUS_UNRESOLVED` Certificate status is unresolved.
    `static int` | `REASON_CRL` CRL exception.
    `static int` | `REASON_OCSP_CERTIFICATE` OCSP certificate error.
    `static int` | `REASON_OCSP_REQUEST_FAILED` OCSP request failed.
    `static int` | `REASON_OCSP_RESPONSE_MALFORMED` OCSP response is malformed.
    `static int` | `REASON_OCSP_RESPONSE_NONCE` OCSP response nonce is invalid.
    `static int` | `REASON_OCSP_RESPONSE_UNSUCCESSFUL` OCSP response status is unsuccessful.
    `static int` | `REASON_OCSP_SIGNATURE` OCSP signature error.
    `static int` | `REASON_TSL` TSL exception.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CertValidatorException(String message, int reason)` Creates a CertValidatorException with the given parameters.
    `CertValidatorException(String message, int reason, X509Certificate certificate, Date revocationTime, CRLReason revocationReason)` Creates a CertValidatorException with the given parameters.
    `CertValidatorException(String message, Throwable cause, int reason)` Creates a CertValidatorException with the given parameters.
    `CertValidatorException(String message, Throwable cause, int reason, X509Certificate certificate, Date revocationTime, CRLReason revocationReason)` Creates a CertValidatorException with the given parameters.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `X509Certificate` | `getCertificate()` Returns the certificate that was being validated.
    `String` | `getMessage()`
    `int` | `getReason()` Returns the reason code of this exception.
    `CRLReason` | `getRevocationReason()` Returns the reason the certificate has been revoked, or `null`.
    `Date` | `getRevocationTime()` Returns the revocation time of the certificate that was being validated.
    `void` | `setCertificate(X509Certificate certificate)`
    `void` | `setRevocationReason(CRLReason revocationReason)`
    `void` | `setRevocationTime(Date revocationTime)`

    - ### Methods inherited from class java.lang.Throwable

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### REASON_CERT_STATUS_REVOKED

          public static final int REASON_CERT_STATUS_REVOKED

      Certificate is revoked.
      See Also:
        Constant Field Values

    - #### REASON_CERT_STATUS_UNKNOWN

          public static final int REASON_CERT_STATUS_UNKNOWN

      Certificate status is unknown.
      See Also:
        Constant Field Values

    - #### REASON_CERT_STATUS_UNRESOLVED

          public static final int REASON_CERT_STATUS_UNRESOLVED

      Certificate status is unresolved.
      See Also:
        Constant Field Values

    - #### REASON_CERT_EXPIRED

          public static final int REASON_CERT_EXPIRED

      Certificate has expired.
      See Also:
        Constant Field Values

    - #### REASON_CERT_NOT_YET_VALID

          public static final int REASON_CERT_NOT_YET_VALID

      Certificate is not yet valid.
      See Also:
        Constant Field Values

    - #### REASON_OCSP_REQUEST_FAILED

          public static final int REASON_OCSP_REQUEST_FAILED

      OCSP request failed.
      See Also:
        Constant Field Values

    - #### REASON_OCSP_RESPONSE_MALFORMED

          public static final int REASON_OCSP_RESPONSE_MALFORMED

      OCSP response is malformed.
      See Also:
        Constant Field Values

    - #### REASON_OCSP_RESPONSE_UNSUCCESSFUL

          public static final int REASON_OCSP_RESPONSE_UNSUCCESSFUL

      OCSP response status is unsuccessful.
      See Also:
        Constant Field Values

    - #### REASON_OCSP_RESPONSE_NONCE

          public static final int REASON_OCSP_RESPONSE_NONCE

      OCSP response nonce is invalid.
      See Also:
        Constant Field Values

    - #### REASON_OCSP_CERTIFICATE

          public static final int REASON_OCSP_CERTIFICATE

      OCSP certificate error.
      See Also:
        Constant Field Values

    - #### REASON_OCSP_SIGNATURE

          public static final int REASON_OCSP_SIGNATURE

      OCSP signature error.
      See Also:
        Constant Field Values

    - #### REASON_CRL

          public static final int REASON_CRL

      CRL exception.
      See Also:
        Constant Field Values

    - #### REASON_TSL

          public static final int REASON_TSL

      TSL exception.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CertValidatorException

          public CertValidatorException(String message,
                                        int reason)

      Creates a CertValidatorException with the given parameters.

    - #### CertValidatorException

          public CertValidatorException(String message,
                                        Throwable cause,
                                        int reason)

      Creates a CertValidatorException with the given parameters.

    - #### CertValidatorException

          public CertValidatorException(String message,
                                        int reason,
                                        X509Certificate certificate,
                                        Date revocationTime,
                                        CRLReason revocationReason)

      Creates a CertValidatorException with the given parameters.

    - #### CertValidatorException

          public CertValidatorException(String message,
                                        Throwable cause,
                                        int reason,
                                        X509Certificate certificate,
                                        Date revocationTime,
                                        CRLReason revocationReason)

      Creates a CertValidatorException with the given parameters.

  - ### Method Detail

    - #### getReason

          public int getReason()

      Returns the reason code of this exception.
      Returns:
        the reason code.

    - #### getCertificate

          public X509Certificate getCertificate()

      Returns the certificate that was being validated.
      Returns:
        the certificate.

    - #### setCertificate

          public void setCertificate(X509Certificate certificate)

    - #### getRevocationTime

          public Date getRevocationTime()

      Returns the revocation time of the certificate that was being validated.
      Returns:
        the revocation time.

    - #### setRevocationTime

          public void setRevocationTime(Date revocationTime)

    - #### getRevocationReason

          public CRLReason getRevocationReason()

      Returns the reason the certificate has been revoked, or `null`.
      Returns:
        the reason.

    - #### setRevocationReason

          public void setRevocationReason(CRLReason revocationReason)

    - #### getMessage

          public String getMessage()

      Overrides:
        `getMessage` in class `Throwable`

Copyright VAS Latvijas Valsts radio un televizijas centrs / Developed by SIA EUSO