Class CertException

  • All Implemented Interfaces:
    java.io.Serializable

    public class CertException
    extends java.lang.SecurityException
    CertException indicates one of a variety of certificate problems.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int err_CONSTRUCTION
      Indicates an error constructing a certificate or certificate chain.
      static int err_ENCODING
      Indicates a problem with the certificate encoding
      static int err_INVALID_FORMAT
      Indicates a problem with the certificate format
      static int err_INVALID_PUBLIC_KEY
      Indicates a problem with the public key
      static int err_INVALID_VERSION
      Indicates a problem with the certificate version
      static int verf_CA_UNTRUSTED
      Indicates that a certificate authority in the certification chain is not trusted.
      static int verf_CHAIN_LENGTH
      Indicates that the certification chain is too long.
      static int verf_INVALID_EXPIRED
      Indicates that the certificate has expired and so is not valid.
      static int verf_INVALID_NOTBEFORE
      Indicates that the certificate is not yet valid.
      static int verf_INVALID_REVOKED
      Indicates that the certificate was revoked, and so is invalid.
      static int verf_INVALID_SIG
      Indicates that the signature in the certificate is not valid.
      static int verf_PARSE_ERROR
      Indicates an error parsing the ASN.1/DER encoding of the certificate.
    • Constructor Summary

      Constructors 
      Constructor Description
      CertException​(int code)
      Constructs a certificate exception using just an error code, without a string describing the context.
      CertException​(int code, java.lang.String moredata)
      Constructs a certificate exception using an error code (verf_*) and a string describing the context of the error.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getMessage()
      Returns a string describing the certificate exception.
      java.lang.String getMoreData()
      Returns a string describing the context in which the exception was reported.
      int getVerfCode()
      Returns the error code with which the exception was created.
      java.lang.String getVerfDescription()
      Return a string corresponding to the error code used to create this exception.
      java.lang.String toString()
      Returns a string describing the certificate exception.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • verf_INVALID_SIG

        public static final int verf_INVALID_SIG
        Indicates that the signature in the certificate is not valid.
        See Also:
        Constant Field Values
      • verf_INVALID_REVOKED

        public static final int verf_INVALID_REVOKED
        Indicates that the certificate was revoked, and so is invalid.
        See Also:
        Constant Field Values
      • verf_INVALID_NOTBEFORE

        public static final int verf_INVALID_NOTBEFORE
        Indicates that the certificate is not yet valid.
        See Also:
        Constant Field Values
      • verf_INVALID_EXPIRED

        public static final int verf_INVALID_EXPIRED
        Indicates that the certificate has expired and so is not valid.
        See Also:
        Constant Field Values
      • verf_CA_UNTRUSTED

        public static final int verf_CA_UNTRUSTED
        Indicates that a certificate authority in the certification chain is not trusted.
        See Also:
        Constant Field Values
      • verf_CHAIN_LENGTH

        public static final int verf_CHAIN_LENGTH
        Indicates that the certification chain is too long.
        See Also:
        Constant Field Values
      • verf_PARSE_ERROR

        public static final int verf_PARSE_ERROR
        Indicates an error parsing the ASN.1/DER encoding of the certificate.
        See Also:
        Constant Field Values
      • err_CONSTRUCTION

        public static final int err_CONSTRUCTION
        Indicates an error constructing a certificate or certificate chain.
        See Also:
        Constant Field Values
      • err_INVALID_PUBLIC_KEY

        public static final int err_INVALID_PUBLIC_KEY
        Indicates a problem with the public key
        See Also:
        Constant Field Values
      • err_INVALID_VERSION

        public static final int err_INVALID_VERSION
        Indicates a problem with the certificate version
        See Also:
        Constant Field Values
      • err_INVALID_FORMAT

        public static final int err_INVALID_FORMAT
        Indicates a problem with the certificate format
        See Also:
        Constant Field Values
      • err_ENCODING

        public static final int err_ENCODING
        Indicates a problem with the certificate encoding
        See Also:
        Constant Field Values
    • Constructor Detail

      • CertException

        public CertException​(int code,
                             java.lang.String moredata)
        Constructs a certificate exception using an error code (verf_*) and a string describing the context of the error.
      • CertException

        public CertException​(int code)
        Constructs a certificate exception using just an error code, without a string describing the context.
    • Method Detail

      • getVerfCode

        public int getVerfCode()
        Returns the error code with which the exception was created.
      • getMoreData

        public java.lang.String getMoreData()
        Returns a string describing the context in which the exception was reported.
      • getVerfDescription

        public java.lang.String getVerfDescription()
        Return a string corresponding to the error code used to create this exception.
      • toString

        public java.lang.String toString()
        Returns a string describing the certificate exception.
        Overrides:
        toString in class java.lang.Throwable
      • getMessage

        public java.lang.String getMessage()
        Returns a string describing the certificate exception.
        Overrides:
        getMessage in class java.lang.Throwable