src/share/classes/java/security/cert/CertificateRevokedException.java
Print this page
*** 37,47 ****
import sun.security.util.ObjectIdentifier;
import sun.security.x509.InvalidityDateExtension;
/**
* An exception that indicates an X.509 certificate is revoked. A
! * <code>CertificateRevokedException</code> 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
--- 37,47 ----
import sun.security.util.ObjectIdentifier;
import sun.security.x509.InvalidityDateExtension;
/**
* An exception that indicates an X.509 certificate is revoked. A
! * {@code 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
*** 58,91 ****
/**
* @serial the revocation reason
*/
private final CRLReason reason;
/**
! * @serial the <code>X500Principal</code> that represents the name of the
* authority that signed the certificate's revocation status information
*/
private final X500Principal authority;
private transient Map<String, Extension> extensions;
/**
! * Constructs a <code>CertificateRevokedException</code> with
* the specified revocation date, reason code, authority name, and map
* of extensions.
*
* @param revocationDate the date on which the certificate was revoked. The
* date is copied to protect against subsequent modification.
* @param reason the revocation reason
* @param extensions 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.
! * @param authority the <code>X500Principal</code> that represents the name
* of the authority that signed the certificate's revocation status
* information
! * @throws NullPointerException if <code>revocationDate</code>,
! * <code>reason</code>, <code>authority</code>, or
! * <code>extensions</code> is <code>null</code>
*/
public CertificateRevokedException(Date revocationDate, CRLReason reason,
X500Principal authority, Map<String, Extension> extensions) {
if (revocationDate == null || reason == null || authority == null ||
extensions == null) {
--- 58,91 ----
/**
* @serial the revocation reason
*/
private final CRLReason reason;
/**
! * @serial the {@code X500Principal} that represents the name of the
* authority that signed the certificate's revocation status information
*/
private final X500Principal authority;
private transient Map<String, Extension> extensions;
/**
! * Constructs a {@code CertificateRevokedException} with
* the specified revocation date, reason code, authority name, and map
* of extensions.
*
* @param revocationDate the date on which the certificate was revoked. The
* date is copied to protect against subsequent modification.
* @param reason the revocation reason
* @param extensions 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.
! * @param authority the {@code X500Principal} that represents the name
* of the authority that signed the certificate's revocation status
* information
! * @throws NullPointerException if {@code revocationDate},
! * {@code reason}, {@code authority}, or
! * {@code extensions} is {@code null}
*/
public CertificateRevokedException(Date revocationDate, CRLReason reason,
X500Principal authority, Map<String, Extension> extensions) {
if (revocationDate == null || reason == null || authority == null ||
extensions == null) {
*** 119,147 ****
/**
* Returns the name of the authority that signed the certificate's
* revocation status information.
*
! * @return the <code>X500Principal</code> that represents the name of the
* authority that signed the certificate's revocation status information
*/
public X500Principal getAuthorityName() {
return authority;
}
/**
* Returns the invalidity date, as specifed in the Invalidity Date
! * extension of this <code>CertificateRevokedException</code>. 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 <code>getExtensions()</code> 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.
*
! * @return the invalidity date, or <code>null</code> if not specified
*/
public Date getInvalidityDate() {
Extension ext = getExtensions().get("2.5.29.24");
if (ext == null) {
return null;
--- 119,147 ----
/**
* Returns the name of the authority that signed the certificate's
* revocation status information.
*
! * @return the {@code X500Principal} that represents the name of the
* authority that signed the certificate's revocation status information
*/
public X500Principal getAuthorityName() {
return authority;
}
/**
* Returns the invalidity date, as specifed in the Invalidity Date
! * extension of this {@code 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 {@code 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.
*
! * @return the invalidity date, or {@code null} if not specified
*/
public Date getInvalidityDate() {
Extension ext = getExtensions().get("2.5.29.24");
if (ext == null) {
return null;
*** 174,184 ****
+ reason + ", revocation date: " + revocationDate
+ ", authority: " + authority + ", extensions: " + extensions;
}
/**
! * Serialize this <code>CertificateRevokedException</code> instance.
*
* @serialData the size of the extensions map (int), followed by all of
* 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
--- 174,184 ----
+ reason + ", revocation date: " + revocationDate
+ ", authority: " + authority + ", extensions: " + extensions;
}
/**
! * Serialize this {@code CertificateRevokedException} instance.
*
* @serialData the size of the extensions map (int), followed by all of
* 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
*** 206,216 ****
oos.write(extVal);
}
}
/**
! * Deserialize the <code>CertificateRevokedException</code> instance.
*/
private void readObject(ObjectInputStream ois)
throws IOException, ClassNotFoundException {
// Read in the non-transient fields
// (revocationDate, reason, authority)
--- 206,216 ----
oos.write(extVal);
}
}
/**
! * Deserialize the {@code CertificateRevokedException} instance.
*/
private void readObject(ObjectInputStream ois)
throws IOException, ClassNotFoundException {
// Read in the non-transient fields
// (revocationDate, reason, authority)