summaryrefslogtreecommitdiffstats
path: root/pki/base/util/src/netscape/security/extensions/CertificateScopeOfUseExtension.java
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base/util/src/netscape/security/extensions/CertificateScopeOfUseExtension.java')
-rw-r--r--pki/base/util/src/netscape/security/extensions/CertificateScopeOfUseExtension.java51
1 files changed, 26 insertions, 25 deletions
diff --git a/pki/base/util/src/netscape/security/extensions/CertificateScopeOfUseExtension.java b/pki/base/util/src/netscape/security/extensions/CertificateScopeOfUseExtension.java
index 1e2706cf..b6b8a87a 100644
--- a/pki/base/util/src/netscape/security/extensions/CertificateScopeOfUseExtension.java
+++ b/pki/base/util/src/netscape/security/extensions/CertificateScopeOfUseExtension.java
@@ -32,24 +32,26 @@ import netscape.security.x509.Extension;
import netscape.security.x509.OIDMap;
/**
- * This represents the CertificateScopeOfUse extension as defined in
- * draft-thayes-cert-scope-00
- *
- * CertificateScopeEntry ::= SEQUENCE { name GeneralName, -- pattern, as for
- * NameConstraints portNumber INTEGER OPTIONAL } CertificateScopeOfUse ::=
- * SEQUENCE OF CertificateScopeEntry
- *
+ * This represents the CertificateScopeOfUse extension
+ * as defined in draft-thayes-cert-scope-00
+ *
+ * CertificateScopeEntry ::= SEQUENCE {
+ * name GeneralName, -- pattern, as for NameConstraints
+ * portNumber INTEGER OPTIONAL
+ * }
+ * CertificateScopeOfUse ::= SEQUENCE OF CertificateScopeEntry
+ *
* @author thomask
* @version $Revision$, $Date$
*/
-public class CertificateScopeOfUseExtension extends Extension implements
- CertAttrSet {
+public class CertificateScopeOfUseExtension extends Extension
+ implements CertAttrSet {
/**
*
*/
private static final long serialVersionUID = 2143292831971567770L;
public static final String NAME = "CertificateScopeOfUse";
- public static final int OID[] = { 2, 16, 840, 1, 113730, 1, 17 };
+ public static final int OID[] = { 2, 16, 840, 1, 113730, 1, 17};
public static final ObjectIdentifier ID = new ObjectIdentifier(OID);
private Vector mEntries = null;
@@ -57,13 +59,13 @@ public class CertificateScopeOfUseExtension extends Extension implements
static {
try {
OIDMap.addAttribute(CertificateScopeOfUseExtension.class.getName(),
- ID.toString(), NAME);
+ ID.toString(), NAME);
} catch (CertificateException e) {
}
}
public CertificateScopeOfUseExtension(boolean critical, Vector scopeEntries)
- throws IOException {
+ throws IOException {
this.extensionId = ID;
this.critical = critical;
this.extensionValue = null; // build this when encodeThis() is called
@@ -77,8 +79,8 @@ public class CertificateScopeOfUseExtension extends Extension implements
this.extensionValue = null; // build this when encodeThis() is called
}
- public CertificateScopeOfUseExtension(Boolean critical, Object value)
- throws IOException {
+ public CertificateScopeOfUseExtension(Boolean critical, Object value)
+ throws IOException {
this.extensionId = ID;
this.critical = critical.booleanValue();
this.extensionValue = (byte[]) ((byte[]) value).clone();
@@ -135,17 +137,16 @@ public class CertificateScopeOfUseExtension extends Extension implements
DerValue val = new DerValue(this.extensionValue);
if (val.tag != DerValue.tag_Sequence) {
- throw new IOException(
- "Invalid encoding of CertificateWindow extension");
+ throw new IOException("Invalid encoding of CertificateWindow extension");
}
mEntries = new Vector();
while (val.data.available() != 0) {
- mEntries.addElement(new CertificateScopeEntry(val.data
- .getDerValue()));
+ mEntries.addElement(new CertificateScopeEntry(
+ val.data.getDerValue()));
}
}
- private void encodeThis() throws IOException {
+ private void encodeThis() throws IOException {
DerOutputStream seq = new DerOutputStream();
DerOutputStream tmp = new DerOutputStream();
@@ -153,8 +154,8 @@ public class CertificateScopeOfUseExtension extends Extension implements
throw new IOException("Invalid Scope Entries");
for (int i = 0; i < mEntries.size(); i++) {
- CertificateScopeEntry se = (CertificateScopeEntry) mEntries
- .elementAt(i);
+ CertificateScopeEntry se = (CertificateScopeEntry)
+ mEntries.elementAt(i);
se.encode(tmp);
}
@@ -162,10 +163,10 @@ public class CertificateScopeOfUseExtension extends Extension implements
seq.write(DerValue.tag_Sequence, tmp);
this.extensionValue = seq.toByteArray();
}
-
+
/**
* Write the extension to the DerOutputStream.
- *
+ *
* @param out the DerOutputStream to write the extension to.
* @exception IOException on encoding errors.
*/
@@ -187,8 +188,8 @@ public class CertificateScopeOfUseExtension extends Extension implements
if (mEntries != null) {
for (int i = 0; i < mEntries.size(); i++) {
- CertificateScopeEntry se = (CertificateScopeEntry) mEntries
- .elementAt(i);
+ CertificateScopeEntry se = (CertificateScopeEntry)
+ mEntries.elementAt(i);
s += se.toString();
}