APIdia Launch Partner
Top Description Fields Constructors Methods
java.security.cert

public Class CertificateRevokedException

extends CertificateException
Class Inheritance
Imports
java.io.ObjectInputStream, .ObjectOutputStream, .IOException, .InvalidObjectException, java.util.Collections, .Date, .HashMap, .Map, javax.security.auth.x500.X500Principal, sun.security.util.IOUtils, .KnownOIDs, .ObjectIdentifier, sun.security.x509.InvalidityDateExtension

An exception that indicates an X.509 certificate is revoked. A CertificateRevokedException contains additional information about the revoked certificate, such as the date on which the certificate was revoked and the reason it was revoked.
Author
Sean Mullan
Since
1.7
See Also
CertPathValidatorException

Field Summary

Modifier and TypeField and Description
private final X500Principal
private transient Map<String, Extension>
private final CRLReason
private Date
private static final long

Constructor Summary

AccessConstructor and Description
public
CertificateRevokedException(Date
the date on which the certificate was revoked. The date is copied to protect against subsequent modification.
revocationDate
,
CRLReason
the revocation reason
reason
,
X500Principal
the X500Principal that represents the name of the authority that signed the certificate's revocation status information
authority
,
Map<String, Extension>
a map of X.509 Extensions. Each key is an OID String that maps to the corresponding Extension. The map is copied to prevent subsequent modification.
extensions
)

Constructs a CertificateRevokedException with the specified revocation date, reason code, authority name, and map of extensions.

Method Summary

Modifier and TypeMethod and Description
public X500Principal

Returns:

the X500Principal that represents the name of the authority that signed the certificate's revocation status information
getAuthorityName
()

Returns the name of the authority that signed the certificate's revocation status information.

public Map<String, Extension>

Returns:

an unmodifiable map of X.509 extensions, or an empty map if there are no extensions
getExtensions
()

Returns a map of X.509 extensions containing additional information about the revoked certificate, such as the Invalidity Date Extension.

public Date

Returns:

the invalidity date, or null if not specified
getInvalidityDate
()

Returns the invalidity date, as specified in the Invalidity Date extension of this CertificateRevokedException.

public String
getMessage()

Overrides java.lang.Throwable.getMessage.

Returns the detail message string of this throwable.

public Date

Returns:

the revocation date
getRevocationDate
()

Returns the date on which the certificate was revoked.

public CRLReason

Returns:

the revocation reason
getRevocationReason
()

Returns the reason the certificate was revoked.

private static boolean
isNull(Date revocationDate, CRLReason reason, X500Principal authority, Map<String, Extension> extensions)

private void
readObject(ObjectInputStream
the ObjectInputStream from which data is read
ois
)

Hides java.lang.Throwable.readObject.

Deserialize the CertificateRevokedException instance.

private void
writeObject(ObjectOutputStream
the ObjectOutputStream to which data is written
oos
)

Hides java.lang.Throwable.writeObject.

Serialize this CertificateRevokedException instance.

Field Detail

authorityback to summary
private final X500Principal authority
extensionsback to summary
private transient Map<String, Extension> extensions
reasonback to summary
private final CRLReason reason
revocationDateback to summary
private Date revocationDate
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.security.cert.CertificateException.serialVersionUID.

Annotations
@Serial

Constructor Detail

CertificateRevokedExceptionback to summary
public CertificateRevokedException(Date revocationDate, CRLReason reason, X500Principal authority, Map<String, Extension> extensions)

Constructs a CertificateRevokedException with the specified revocation date, reason code, authority name, and map of extensions.

Parameters
revocationDate:Date

the date on which the certificate was revoked. The date is copied to protect against subsequent modification.

reason:CRLReason

the revocation reason

authority:X500Principal

the X500Principal that represents the name of the authority that signed the certificate's revocation status information

extensions:Map<String, Extension>

a map of X.509 Extensions. Each key is an OID String that maps to the corresponding Extension. The map is copied to prevent subsequent modification.

Exceptions
NullPointerException:
if revocationDate, reason, authority, or extensions is null
ClassCastException:
if extensions contains an incorrectly typed key or value

Method Detail

getAuthorityNameback to summary
public X500Principal getAuthorityName()

Returns the name of the authority that signed the certificate's revocation status information.

Returns:X500Principal

the X500Principal that represents the name of the authority that signed the certificate's revocation status information

getExtensionsback to summary
public Map<String, Extension> getExtensions()

Returns a map of X.509 extensions containing additional information about the revoked certificate, such as the Invalidity Date Extension. Each key is an OID String that maps to the corresponding Extension.

Returns:Map<String, Extension>

an unmodifiable map of X.509 extensions, or an empty map if there are no extensions

getInvalidityDateback to summary
public Date getInvalidityDate()

Returns the invalidity date, as specified in the Invalidity Date extension of this CertificateRevokedException. The invalidity date is the date on which it is known or suspected that the private key was compromised or that the certificate otherwise became invalid. This implementation calls getExtensions() and checks the returned map for an entry for the Invalidity Date extension OID ("2.5.29.24"). If found, it returns the invalidity date in the extension; otherwise null. A new Date object is returned each time the method is invoked to protect against subsequent modification.

Returns:Date

the invalidity date, or null if not specified

getMessageback to summary
public String getMessage()

Overrides java.lang.Throwable.getMessage.

Doc from java.lang.Throwable.getMessage.

Returns the detail message string of this throwable.

Annotations
@Override
getRevocationDateback to summary
public Date getRevocationDate()

Returns the date on which the certificate was revoked. A new copy is returned each time the method is invoked to protect against subsequent modification.

Returns:Date

the revocation date

getRevocationReasonback to summary
public CRLReason getRevocationReason()

Returns the reason the certificate was revoked.

Returns:CRLReason

the revocation reason

isNullback to summary
private static boolean isNull(Date revocationDate, CRLReason reason, X500Principal authority, Map<String, Extension> extensions)
readObjectback to summary
private void readObject(ObjectInputStream ois) throws IOException, ClassNotFoundException

Hides java.lang.Throwable.readObject.

Deserialize the CertificateRevokedException instance.

Parameters
ois:ObjectInputStream

the ObjectInputStream from which data is read

Annotations
@Serial
Exceptions
IOException:
if an I/O error occurs
ClassNotFoundException:
if a serialized class cannot be loaded
writeObjectback to summary
private void writeObject(ObjectOutputStream oos) throws IOException

Hides java.lang.Throwable.writeObject.

Serialize this CertificateRevokedException instance.

Parameters
oos:ObjectOutputStream

the ObjectOutputStream to which data is written

Annotations
@Serial
Exceptions
IOException:
if an I/O error occurs
Serial data
the size of the extensions map (int), followed by all the extensions in the map, in no particular order. For each extension, the following data is emitted: the OID String (Object), the criticality flag (boolean), the length of the encoded extension value byte array (int), and the encoded extension value bytes.