summaryrefslogtreecommitdiffstats
path: root/pki/base/util/src/netscape/security/x509/InvalidityDateExtension.java
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base/util/src/netscape/security/x509/InvalidityDateExtension.java')
-rwxr-xr-xpki/base/util/src/netscape/security/x509/InvalidityDateExtension.java79
1 files changed, 36 insertions, 43 deletions
diff --git a/pki/base/util/src/netscape/security/x509/InvalidityDateExtension.java b/pki/base/util/src/netscape/security/x509/InvalidityDateExtension.java
index cb568c7fa..30c33b213 100755
--- a/pki/base/util/src/netscape/security/x509/InvalidityDateExtension.java
+++ b/pki/base/util/src/netscape/security/x509/InvalidityDateExtension.java
@@ -30,22 +30,18 @@ import netscape.security.util.DerInputStream;
import netscape.security.util.DerOutputStream;
import netscape.security.util.DerValue;
-
/**
* Represent the CRL Invalidity Date Extension.
- *
- * <p>This CRL entry extension, if present, provides the date
- * on which it is known or suspected that the private key was
- * compromised or that the certificate otherwise became invalid.
- * Invalidity date may be earlier than the revocation date.
- *
+ *
+ * <p>
+ * This CRL entry extension, if present, provides the date on which it is known or suspected that the private key was compromised or that the certificate otherwise became invalid. Invalidity date may be earlier than the revocation date.
+ *
* @see Extension
* @see CertAttrSet
*/
-
public class InvalidityDateExtension extends Extension
-implements CertAttrSet {
+ implements CertAttrSet {
/**
*
@@ -62,14 +58,14 @@ implements CertAttrSet {
*/
public static final String OID = "2.5.29.24";
-
private Date invalidityDate = null;
static {
try {
OIDMap.addAttribute(InvalidityDateExtension.class.getName(),
OID, NAME);
- } catch (CertificateException e) {}
+ } catch (CertificateException e) {
+ }
}
// Encode this extension value
@@ -84,12 +80,11 @@ implements CertAttrSet {
/**
* Create a InvalidityDateExtension with the date.
* The criticality is set to false.
- *
+ *
* @param dateOfInvalidity the value to be set for the extension.
*/
public InvalidityDateExtension(Date dateOfInvalidity)
- throws IOException
- {
+ throws IOException {
this.invalidityDate = dateOfInvalidity;
this.extensionId = PKIXExtensions.InvalidityDate_Id;
this.critical = false;
@@ -99,13 +94,12 @@ implements CertAttrSet {
/**
* Create a InvalidityDateExtension with the date.
* The criticality is set to false.
- *
+ *
* @param critical true if the extension is to be treated as critical.
* @param dateOfInvalidity the value to be set for the extension.
*/
public InvalidityDateExtension(Boolean critical, Date dateOfInvalidity)
- throws IOException
- {
+ throws IOException {
this.invalidityDate = dateOfInvalidity;
this.extensionId = PKIXExtensions.InvalidityDate_Id;
this.critical = critical.booleanValue();
@@ -114,14 +108,13 @@ implements CertAttrSet {
/**
* Create the extension from the passed DER encoded value of the same.
- *
+ *
* @param critical true if the extension is to be treated as critical.
* @param value Array of DER encoded bytes of the actual value.
* @exception IOException on error.
*/
public InvalidityDateExtension(Boolean critical, Object value)
- throws IOException
- {
+ throws IOException {
this.extensionId = PKIXExtensions.InvalidityDate_Id;
this.critical = critical.booleanValue();
@@ -143,8 +136,7 @@ implements CertAttrSet {
/**
* Get the invalidity date.
*/
- public Date getInvalidityDate()
- {
+ public Date getInvalidityDate() {
return invalidityDate;
}
@@ -156,9 +148,9 @@ implements CertAttrSet {
if (!(obj instanceof Date)) {
throw new IOException("Attribute must be of type Date.");
}
- invalidityDate = (Date)obj;
- } else {
- throw new IOException("Attribute name not recognized by"+
+ invalidityDate = (Date) obj;
+ } else {
+ throw new IOException("Attribute name not recognized by" +
" CertAttrSet:InvalidityDate.");
}
}
@@ -168,10 +160,12 @@ implements CertAttrSet {
*/
public Object get(String name) throws IOException {
if (name.equalsIgnoreCase(INVALIDITY_DATE)) {
- if (invalidityDate == null) return null;
- else return invalidityDate;
+ if (invalidityDate == null)
+ return null;
+ else
+ return invalidityDate;
} else {
- throw new IOException("Attribute name not recognized by"+
+ throw new IOException("Attribute name not recognized by" +
" CertAttrSet:InvalidityDate.");
}
}
@@ -183,7 +177,7 @@ implements CertAttrSet {
if (name.equalsIgnoreCase(INVALIDITY_DATE)) {
invalidityDate = null;
} else {
- throw new IOException("Attribute name not recognized by"+
+ throw new IOException("Attribute name not recognized by" +
" CertAttrSet:InvalidityDate.");
}
}
@@ -200,7 +194,7 @@ implements CertAttrSet {
/**
* Decode the extension from the InputStream.
- *
+ *
* @param in the InputStream to unmarshal the contents from.
* @exception IOException on decoding or validity errors.
*/
@@ -210,27 +204,27 @@ implements CertAttrSet {
/**
* Write the extension to the DerOutputStream.
- *
+ *
* @param out the DerOutputStream to write the extension to.
* @exception IOException on encoding errors.
*/
public void encode(OutputStream out) throws IOException {
- DerOutputStream tmp = new DerOutputStream();
-
- if (this.extensionValue == null) {
- this.extensionId = PKIXExtensions.InvalidityDate_Id;
- this.critical = true;
- encodeThis();
- }
- super.encode(tmp);
- out.write(tmp.toByteArray());
+ DerOutputStream tmp = new DerOutputStream();
+
+ if (this.extensionValue == null) {
+ this.extensionId = PKIXExtensions.InvalidityDate_Id;
+ this.critical = true;
+ encodeThis();
+ }
+ super.encode(tmp);
+ out.write(tmp.toByteArray());
}
/**
* Return an enumeration of names of attributes existing within this
* attribute.
*/
- public Enumeration<String> getElements () {
+ public Enumeration<String> getElements() {
Vector<String> elements = new Vector<String>();
elements.addElement(INVALIDITY_DATE);
return (elements.elements());
@@ -239,8 +233,7 @@ implements CertAttrSet {
/**
* Return the name of this attribute.
*/
- public String getName () {
+ public String getName() {
return (NAME);
}
}
-