iaik.x509.extensions.netscape
Class NetscapeBaseUrl

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

public class NetscapeBaseUrl
extends V3Extension

This class implements the NetscapeBaseUrl 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 NetscapeBaseUrl extension is defined as:

netscape-base-url OBJECT IDENTIFIER ::= { netscape-cert-extension 2 }

which corresponds to the OID string "2.16.840.1.113730.1.2".

The Netscape Certificate Specification specifies the NetscapeBaseUrl extension as IA5String that - when present - is added to the beginning of all relative URLs in the certificate.

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

 NetscapeBaseUrl netscapeBaseUrl = new NetscapeBaseUrl();
 netscapeBaseUrl.setBaseUrl("https://www.certs-r-us.com/");
 

Version:
File Revision 15
See Also:
V3Extension, X509Extensions, NetscapeCaPolicyUrl, NetscapeCaRevocationUrl, NetscapeCertRenewalUrl, NetscapeRevocationUrl

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

NetscapeBaseUrl

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

Use the setBaseUrl method for explicitly setting some particular URL, e.g.:

 NetscapeBaseUrl netscapeBaseUrl = new NetscapeBaseUrl();
 netscapeBaseUrl.setBaseUrl("https://www.certs-r-us.com/");
 


NetscapeBaseUrl

public NetscapeBaseUrl(String url)
Constructs a NetscapeBaseUrl extension with a specified URL.

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

NetscapeBaseUrl netscapeBaseUrl = new NetscapeBaseUrl("https://www.certs-r-us.com/");

Parameters:
url - the base URL, as String
Method Detail

getObjectID

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

init

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

The given ASN1Object represents the IA5STRING URL value.

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 NetscapeBaseUrl 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 netscapeBaseUrl as ASN1Object

toASN1Object

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

The returned ASN1Object represents the IA5STRING URL value.

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

setBaseUrl

public void setBaseUrl(String url)
Sets the base url.

The URL value is given as String, e.g.:

 NetscapeBaseUrl netscapeBaseUrl = new NetscapeBaseUrl();
 netscapeBaseUrl.setBaseUrl("https://www.certs-r-us.com/");
 

Parameters:
url - the base url as String

getBaseUrl

public String getBaseUrl()
Returns the base url.
Returns:
the base url value as String
See Also:
setBaseUrl(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 NetscapeBaseUrl 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