iaik.x509.extensions.netscape
Class NetscapeSSLServerName

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

public class NetscapeSSLServerName
extends V3Extension

This class implements the NetscapeSSLServerName Extension, supported by Netscape Communicator 4.0, but not supported before Preliminary Navigator 3.0b5.

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 NetscapeSSLServerName extension is defined as:

netscape-ssl-server-name OBJECT IDENTIFIER ::= { netscape-cert-extension 12 }

which corresponds to the OID string "2.16.840.1.113730.1.12".

The Netscape Certificate Specification specifies the NetscapeSSLServerName extension as IA5String "shell expression" that can be used to match the hostname of the SSL server that is using this certificate. It is recommended that if the server's hostname does not match this pattern the user be notified and given the option to terminate the SSL connection. If this extension is not present then the CommonName in the certificate subject's distinguished name is used for the same purpose.

You may specify a particular SSL server name directly when creating a NetscapeSSLServerName extension, or you may use the default constructor and supply the name by using the setSSLServerName method, e.g.:

 NetscapeSSLServerName netscapeSSLServerName = new NetscapeSSLServerName();
 netscapeSSLServerName.setSSLServerName("www.netscape.com");
 

Version:
File Revision 14
See Also:
V3Extension, X509Extensions

Field Summary
static ObjectID oid
          The object ID of the X.509 extension NetscapeSSLServerName.
 
Fields inherited from class iaik.x509.V3Extension
critical
 
Constructor Summary
NetscapeSSLServerName()
          Default constructor.
NetscapeSSLServerName(String name)
          Constructs a NetscapeSSLServerName extension with a given SSLServer name.
 
Method Summary
 ObjectID getObjectID()
          Returns the object ID of this NetscapeSSLServerName extension
 String getSSLServerName()
          Returns the SSL server name.
 int hashCode()
          Returns a hashcode for this identity.
 void init(ASN1Object obj)
          Inits this NetscapeSSLServerName implementation with an ASN1object representing the value of this extension.
 void setSSLServerName(String name)
          Sets the SSL server name.
 ASN1Object toASN1Object()
          Returns an ASN1Object representing the value of this NetscapeSSLServerName extension object.
 String toString()
          Returns a string that represents the contents of this NetscapeSSLServerName 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 NetscapeSSLServerName.
Constructor Detail

NetscapeSSLServerName

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

Use the setSSLServerName method for specifying a particular (absolute or relative) name, e.g.:

 NetscapeSSLServerName netscapeSSLServerName = new NetscapeSSLServerName();
 netscapeSSLServerName.setSSLServerName("www.netscape.com");
 


NetscapeSSLServerName

public NetscapeSSLServerName(String name)
Constructs a NetscapeSSLServerName extension with a given SSLServer name.

The SSL server name is given as a String value, for instance:

NetscapeSSLServerName netscapeSSLServerName = new NetscapeSSLServerName("www.netscape.com");

Parameters:
name - the hostname of the SSL server that is using this certificate, as String
Method Detail

getObjectID

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

init

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

The given ASN1Object is the represents the IA5STRING hostname of the SSL server that is using this certificate.

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 NetscapeSSLServerName 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 NetscapeSSLServerName as ASN1Object

toASN1Object

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

The returned ASN1Object represents the IA5STRING hostname of the SSL server.

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

setSSLServerName

public void setSSLServerName(String name)
Sets the SSL server name.

The SSL server name is given as String, e.g.:

 NetscapeSSLServerName netscapeSSLServerName = new NetscapeSSLServerName();
 netscapeSSLServerName.setSSLServerName("www.netscape.com");
 

Parameters:
name - the hostname of the SSL server that is using this certificate, as String

getSSLServerName

public String getSSLServerName()
Returns the SSL server name.
Returns:
the the hostname of the SSL server that is using this certificate, as String
See Also:
setSSLServerName(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 NetscapeSSLServerName 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