public class

CertException

extends SecurityException
java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.lang.RuntimeException
         ↳ java.lang.SecurityException
           ↳ sun.security.x509.CertException

This class is deprecated.
use one of Exceptions defined in the java.security.cert package.

Class Overview

CertException indicates one of a variety of certificate problems.

See Also

Summary

Constants
int err_CONSTRUCTION Indicates an error constructing a certificate or certificate chain.
int err_ENCODING Indicates a problem with the certificate encoding
int err_INVALID_FORMAT Indicates a problem with the certificate format
int err_INVALID_PUBLIC_KEY Indicates a problem with the public key
int err_INVALID_VERSION Indicates a problem with the certificate version
int verf_CA_UNTRUSTED Indicates that a certificate authority in the certification chain is not trusted.
int verf_CHAIN_LENGTH Indicates that the certification chain is too long.
int verf_INVALID_EXPIRED Indicates that the certificate has expired and so is not valid.
int verf_INVALID_NOTBEFORE Indicates that the certificate is not yet valid.
int verf_INVALID_REVOKED Indicates that the certificate was revoked, and so is invalid.
int verf_INVALID_SIG Indicates that the signature in the certificate is not valid.
int verf_PARSE_ERROR Indicates an error parsing the ASN.1/DER encoding of the certificate.
Public Constructors
CertException(int code, String moredata)
Constructs a certificate exception using an error code (verf_*) and a string describing the context of the error.
CertException(int code)
Constructs a certificate exception using just an error code, without a string describing the context.
Public Methods
String getMessage()
Returns a string describing the certificate exception.
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.
String getVerfDescription()
Return a string corresponding to the error code used to create this exception.
String toString()
Returns a string describing the certificate exception.
[Expand]
Inherited Methods
From class java.lang.Throwable
From class java.lang.Object

Constants

public static final int err_CONSTRUCTION

Indicates an error constructing a certificate or certificate chain.

Constant Value: 8 (0x00000008)

public static final int err_ENCODING

Indicates a problem with the certificate encoding

Constant Value: 12 (0x0000000c)

public static final int err_INVALID_FORMAT

Indicates a problem with the certificate format

Constant Value: 11 (0x0000000b)

public static final int err_INVALID_PUBLIC_KEY

Indicates a problem with the public key

Constant Value: 9 (0x00000009)

public static final int err_INVALID_VERSION

Indicates a problem with the certificate version

Constant Value: 10 (0x0000000a)

public static final int verf_CA_UNTRUSTED

Indicates that a certificate authority in the certification chain is not trusted.

Constant Value: 5 (0x00000005)

public static final int verf_CHAIN_LENGTH

Indicates that the certification chain is too long.

Constant Value: 6 (0x00000006)

public static final int verf_INVALID_EXPIRED

Indicates that the certificate has expired and so is not valid.

Constant Value: 4 (0x00000004)

public static final int verf_INVALID_NOTBEFORE

Indicates that the certificate is not yet valid.

Constant Value: 3 (0x00000003)

public static final int verf_INVALID_REVOKED

Indicates that the certificate was revoked, and so is invalid.

Constant Value: 2 (0x00000002)

public static final int verf_INVALID_SIG

Indicates that the signature in the certificate is not valid.

Constant Value: 1 (0x00000001)

public static final int verf_PARSE_ERROR

Indicates an error parsing the ASN.1/DER encoding of the certificate.

Constant Value: 7 (0x00000007)

Public Constructors

public CertException (int code, String moredata)

Constructs a certificate exception using an error code (verf_*) and a string describing the context of the error.

public CertException (int code)

Constructs a certificate exception using just an error code, without a string describing the context.

Public Methods

public String getMessage ()

Returns a string describing the certificate exception.

Returns
  • the detail message string of this Throwable instance (which may be null).

public String getMoreData ()

Returns a string describing the context in which the exception was reported.

public int getVerfCode ()

Returns the error code with which the exception was created.

public String getVerfDescription ()

Return a string corresponding to the error code used to create this exception.

public String toString ()

Returns a string describing the certificate exception.

Returns
  • a string representation of this throwable.