public class NetscapeComment extends V3Extension
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");
V3Extension
,
X509Extensions
Modifier and Type | Field and Description |
---|---|
static ObjectID |
oid
The object ID of the X.509 extension NetscapeComment.
|
critical
Constructor and Description |
---|
NetscapeComment()
Default constructor.
|
NetscapeComment(java.lang.String comment)
Constructs a
NetscapeComment extension with a specified comment. |
Modifier and Type | Method and Description |
---|---|
java.lang.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(java.lang.String comment)
Sets the comment.
|
ASN1Object |
toASN1Object()
Returns an ASN1Object representing the value of this
NetscapeComment
extension object. |
java.lang.String |
toString()
Returns a string that represents the contents of this
NetscapeComment extension. |
getName, isCritical, setCritical
public static final ObjectID oid
public NetscapeComment()
NetscapeComment
object.
Use the setComment
method for
specifying a particular comment e.g.:
NetscapeComment netscapeComment = new NetscapeComment(); netscapeComment.setComment("This is a comment");
public NetscapeComment(java.lang.String comment)
NetscapeComment
extension with a specified comment.
The comment is given as a String value, for instance:
NetscapeComment netscapeComment = new NetscapeComment("This is a comment");
comment
- the comment as Stringpublic ObjectID getObjectID()
NetscapeComment
extensiongetObjectID
in class V3Extension
public void init(ASN1Object obj)
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.
init
in class V3Extension
obj
- the NetscapeComment as ASN1Objectpublic ASN1Object toASN1Object()
NetscapeComment
extension object.
The returned ASN1Object represents the IA5STRING comment to be displayed to the user.
toASN1Object
in class V3Extension
NetscapeComment
as ASN1Objectpublic void setComment(java.lang.String comment)
The comment is given as String, e.g.:
NetscapeComment netscapeComment = new NetscapeComment(); netscapeComment.setComment("This is a comment");
comment
- the comment, as Stringpublic java.lang.String getComment()
setComment(java.lang.String)
public int hashCode()
hashCode
in class V3Extension
public java.lang.String toString()
NetscapeComment
extension.toString
in class java.lang.Object