iaik.x509.extensions.netscape
Class NetscapeComment

java.lang.Object
  |
  +--iaik.x509.V3Extension
        |
        +--iaik.x509.extensions.netscape.NetscapeComment

public class NetscapeComment
extends V3Extension

This class implements the NetscapeComment Extension.

Each Netscape certificate extension is associated with a specific certificateExtension object identifier, derived from:

 netscape OBJECT IDENTIFIER ::= { 2 16 840 1 113730 }
 netscape-cert-extension OBJECT IDENTIFIER :: = { netscape 1 }
 

The object identifier for the NetscapeComment extension is defined as:

netscape-comment OBJECT IDENTIFIER ::= { netscape-cert-extension 13 }

which corresponds to the OID string "2.16.840.1.113730.1.13".

The Netscape Certificate Specification specifies the NetscapeComment extension as IA5String representing a comment that may be displayed to the user when the certificate is viewed.

You may specify a particular comment directly when creating a NetscapeComment extension, or you may use the default constructor and supply the comment by using the setComment method, e.g.:

 NetscapeCooment netscapeComment = new NetscapeComment();
 netscapeCooment.setCooment("This is a comment");
 

Version:
File Revision 14
See Also:
V3Extension, X509Extensions

Field Summary
static ObjectID oid
          The object ID of the X.509 extension NetscapeComment.
 
Fields inherited from class iaik.x509.V3Extension
critical
 
Constructor Summary
NetscapeComment()
          Default constructor.
NetscapeComment(String comment)
          Constructs a NetscapeComment extension with a specified comment.
 
Method Summary
 String getComment()
          Returns the comment.
 ObjectID getObjectID()
          Returns the object ID of this NetscapeComment extension
 int hashCode()
          Returns a hashcode for this identity.
 void init(ASN1Object obj)
          Inits this NetscapeComment implementation with an ASN1object representing the value of this extension.
 void setComment(String comment)
          Sets the comment.
 ASN1Object toASN1Object()
          Returns an ASN1Object representing the value of this NetscapeComment extension object.
 String toString()
          Returns a string that represents the contents of this NetscapeComment extension.
 
Methods inherited from class iaik.x509.V3Extension
getName, isCritical, setCritical
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

oid

public static ObjectID oid
The object ID of the X.509 extension NetscapeComment.
Constructor Detail

NetscapeComment

public NetscapeComment()
Default constructor. Creates an empty NetscapeComment object.

Use the setComment method for specifying a particular comment e.g.:

 NetscapeComment netscapeComment = new NetscapeComment();
 netscapeComment.setComment("This is a comment");
 


NetscapeComment

public NetscapeComment(String comment)
Constructs a NetscapeComment extension with a specified comment.

The comment is given as a String value, for instance:

NetscapeComment netscapeComment = new NetscapeComment("This is a comment");

Parameters:
comment - the comment as String
Method Detail

getObjectID

public ObjectID getObjectID()
Returns the object ID of this NetscapeComment extension
Overrides:
getObjectID in class V3Extension
Returns:
the object ID

init

public void init(ASN1Object obj)
Inits this NetscapeComment implementation with an ASN1object representing the value of this extension.

The given ASN1Object represents the IA5STRING comment to be displayed to the user.

The given ASN1Object is the one created by toASN1Object().

This method is used by the X509Extensions class when parsing the ASN.1 representation of a certificate for properly initializing an included NetscapeComment extension. This method initializes the extension only with its value, but not with its critical specification. For that reason, this method shall not be explicitly called by an application.

Overrides:
init in class V3Extension
Parameters:
obj - the NetscapeComment as ASN1Object

toASN1Object

public ASN1Object toASN1Object()
Returns an ASN1Object representing the value of this NetscapeComment extension object.

The returned ASN1Object represents the IA5STRING comment to be displayed to the user.

Overrides:
toASN1Object in class V3Extension
Returns:
the value of this NetscapeComment as ASN1Object

setComment

public void setComment(String comment)
Sets the comment.

The comment is given as String, e.g.:

 NetscapeComment netscapeComment = new NetscapeComment();
 netscapeComment.setComment("This is a comment");
 

Parameters:
comment - the comment, as String

getComment

public String getComment()
Returns the comment.
Returns:
the comment to be displayed to the user
See Also:
setComment(java.lang.String)

hashCode

public int hashCode()
Returns a hashcode for this identity.
Overrides:
hashCode in class V3Extension
Returns:
a hash code for this identity

toString

public String toString()
Returns a string that represents the contents of this NetscapeComment extension.
Overrides:
toString in class Object
Returns:
the string representation

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK