summaryrefslogtreecommitdiffstats
path: root/pki/base/util/src/netscape/security/x509/CertificateSubjectUniqueIdentity.java
diff options
context:
space:
mode:
Diffstat (limited to 'pki/base/util/src/netscape/security/x509/CertificateSubjectUniqueIdentity.java')
-rw-r--r--pki/base/util/src/netscape/security/x509/CertificateSubjectUniqueIdentity.java62
1 files changed, 31 insertions, 31 deletions
diff --git a/pki/base/util/src/netscape/security/x509/CertificateSubjectUniqueIdentity.java b/pki/base/util/src/netscape/security/x509/CertificateSubjectUniqueIdentity.java
index c214546a..d0c57fb8 100644
--- a/pki/base/util/src/netscape/security/x509/CertificateSubjectUniqueIdentity.java
+++ b/pki/base/util/src/netscape/security/x509/CertificateSubjectUniqueIdentity.java
@@ -28,9 +28,9 @@ import netscape.security.util.DerOutputStream;
import netscape.security.util.DerValue;
/**
- * This class defines the subject/issuer unique identity attribute
- * for the Certificate.
- *
+ * This class defines the subject/issuer unique identity attribute for the
+ * Certificate.
+ *
* @author Amit Kapoor
* @author Hemma Prafullchandra
* @version 1.6
@@ -38,9 +38,9 @@ import netscape.security.util.DerValue;
*/
public class CertificateSubjectUniqueIdentity implements CertAttrSet {
/**
- * Identifier for this attribute, to be used with the
- * get, set, delete methods of Certificate, x509 type.
- */
+ * Identifier for this attribute, to be used with the get, set, delete
+ * methods of Certificate, x509 type.
+ */
public static final String IDENT = "x509.info.subjectID";
/**
* Sub attributes name for this CertAttrSet.
@@ -48,11 +48,11 @@ public class CertificateSubjectUniqueIdentity implements CertAttrSet {
public static final String NAME = "subjectID";
public static final String ID = "id";
- private UniqueIdentity id;
+ private UniqueIdentity id;
/**
* Default constructor for the certificate attribute.
- *
+ *
* @param key the UniqueIdentity
*/
public CertificateSubjectUniqueIdentity(UniqueIdentity id) {
@@ -61,35 +61,33 @@ public class CertificateSubjectUniqueIdentity implements CertAttrSet {
/**
* Create the object, decoding the values from the passed DER stream.
- *
+ *
* @param in the DerInputStream to read the UniqueIdentity from.
* @exception IOException on decoding errors.
*/
public CertificateSubjectUniqueIdentity(DerInputStream in)
- throws IOException {
+ throws IOException {
id = new UniqueIdentity(in);
}
/**
* Create the object, decoding the values from the passed stream.
- *
+ *
* @param in the InputStream to read the UniqueIdentity from.
* @exception IOException on decoding errors.
*/
- public CertificateSubjectUniqueIdentity(InputStream in)
- throws IOException {
+ public CertificateSubjectUniqueIdentity(InputStream in) throws IOException {
DerValue val = new DerValue(in);
id = new UniqueIdentity(val);
}
/**
* Create the object, decoding the values from the passed DER value.
- *
+ *
* @param in the DerValue to read the UniqueIdentity from.
* @exception IOException on decoding errors.
*/
- public CertificateSubjectUniqueIdentity(DerValue val)
- throws IOException {
+ public CertificateSubjectUniqueIdentity(DerValue val) throws IOException {
id = new UniqueIdentity(val);
}
@@ -97,13 +95,14 @@ public class CertificateSubjectUniqueIdentity implements CertAttrSet {
* Return the identity as user readable string.
*/
public String toString() {
- if (id == null) return "";
- return(id.toString());
+ if (id == null)
+ return "";
+ return (id.toString());
}
/**
* Decode the identity in DER form from the stream.
- *
+ *
* @param in the InputStream to unmarshal the contents from.
* @exception IOException on errors.
*/
@@ -114,13 +113,14 @@ public class CertificateSubjectUniqueIdentity implements CertAttrSet {
/**
* Encode the identity in DER form to the stream.
- *
+ *
* @param out the DerOutputStream to marshal the contents to.
* @exception IOException on errors.
*/
public void encode(OutputStream out) throws IOException {
DerOutputStream tmp = new DerOutputStream();
- id.encode(tmp,DerValue.createTag(DerValue.TAG_CONTEXT,false,(byte)2));
+ id.encode(tmp,
+ DerValue.createTag(DerValue.TAG_CONTEXT, false, (byte) 2));
out.write(tmp.toByteArray());
}
@@ -133,10 +133,10 @@ public class CertificateSubjectUniqueIdentity implements CertAttrSet {
throw new IOException("Attribute must be of type UniqueIdentity.");
}
if (name.equalsIgnoreCase(ID)) {
- id = (UniqueIdentity)obj;
+ id = (UniqueIdentity) obj;
} else {
- throw new IOException("Attribute name not recognized by " +
- "CertAttrSet: CertificateSubjectUniqueIdentity.");
+ throw new IOException("Attribute name not recognized by "
+ + "CertAttrSet: CertificateSubjectUniqueIdentity.");
}
}
@@ -145,10 +145,10 @@ public class CertificateSubjectUniqueIdentity implements CertAttrSet {
*/
public Object get(String name) throws IOException {
if (name.equalsIgnoreCase(ID)) {
- return(id);
+ return (id);
} else {
- throw new IOException("Attribute name not recognized by " +
- "CertAttrSet: CertificateSubjectUniqueIdentity.");
+ throw new IOException("Attribute name not recognized by "
+ + "CertAttrSet: CertificateSubjectUniqueIdentity.");
}
}
@@ -159,8 +159,8 @@ public class CertificateSubjectUniqueIdentity implements CertAttrSet {
if (name.equalsIgnoreCase(ID)) {
id = null;
} else {
- throw new IOException("Attribute name not recognized by " +
- "CertAttrSet: CertificateSubjectUniqueIdentity.");
+ throw new IOException("Attribute name not recognized by "
+ + "CertAttrSet: CertificateSubjectUniqueIdentity.");
}
}
@@ -171,10 +171,10 @@ public class CertificateSubjectUniqueIdentity implements CertAttrSet {
public Enumeration<String> getElements() {
Vector<String> elements = new Vector<String>();
elements.addElement(ID);
-
+
return (elements.elements());
}
-
+
/**
* Return the name of this attribute.
*/