iaik.x509.extensions.netscape
Class NetscapeCertType

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

public class NetscapeCertType
extends V3Extension

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

netscape-cert-type OBJECT IDENTIFIER ::= { netscape-cert-extension 1 }

which corresponds to the OID string "2.16.840.1.113730.1.1".

The Netscape Certificate Specification specifies the NetscapeCertType extension for limting the applications for a certificate. If the extension exists in a certificate, it will limit the uses of the certificate to those specified.  If the extension is not present, the certificate can be used for all applications except Object Signing.

The value is a bit-string, where the individual bit positions are defined as:

You may specify some certificate usage type(s) directly when creating a NetscapeCertType extension, or you may use the default constructor and supply the type(s) by using the setCertType method, e.g.:

 NetscapeCertType netscapeCertType = new NetscapeCertType();
 netscapeCertType.setCertType(NetscapeCertType.SSL_CLIENT |
                              NetscapeCertType.SSL_SERVER);
 

Version:
File Revision 17
See Also:
V3Extension, X509Extensions

Field Summary
static int OBJECT_SIGNING
          Indicates a certificate that is certified for signing objects such as Java applets ans plugins.
static int OBJECT_SIGNING_CA
          Indicates a certificate that is certified for issuing certs for Object Signing.
static ObjectID oid
          The object ID of the X.509 extension NetscapeCertType.
static int S_MIME
          Indicates a certificate that is certified for use by clients.
static int S_MIME_CA
          Indicates a certificate that is certified for issuing certs for S/MIME use.
static int SSL_CA
          Indicates a certificate that is certified for issuing certs for SSL use.
static int SSL_CLIENT
          Indicates a certificate that is certified for SSL client authentication use.
static int SSL_SERVER
          Indicates a certificate that is certified for SSL server authentication use.
 
Fields inherited from class iaik.x509.V3Extension
critical
 
Constructor Summary
NetscapeCertType()
          Default constructor.
NetscapeCertType(int type)
          Constructs a NetscapeCertType extension with a specified type parameter.
 
Method Summary
 int getCertType()
          Returns the usage type value of the certificate as an integer.
 ObjectID getObjectID()
          Returns the object ID of this NetscapeCertType extension
 int hashCode()
          Returns a hashcode for this identity.
 void init(ASN1Object obj)
          Inits this NetscapeCertType implementation with an ASN1object representing the value of this extension.
 void setCertType(int type)
          Sets the usage type of the certificate.
 ASN1Object toASN1Object()
          Returns an ASN1Object representing the value of this NetscapeCertType extension object.
 String toString()
          Returns a string that represents the contents of this NetscapeCertType 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 NetscapeCertType.

SSL_CLIENT

public static int SSL_CLIENT
Indicates a certificate that is certified for SSL client authentication use.

SSL_SERVER

public static int SSL_SERVER
Indicates a certificate that is certified for SSL server authentication use.

S_MIME

public static int S_MIME
Indicates a certificate that is certified for use by clients.

OBJECT_SIGNING

public static int OBJECT_SIGNING
Indicates a certificate that is certified for signing objects such as Java applets ans plugins.

SSL_CA

public static int SSL_CA
Indicates a certificate that is certified for issuing certs for SSL use.

S_MIME_CA

public static int S_MIME_CA
Indicates a certificate that is certified for issuing certs for S/MIME use.

OBJECT_SIGNING_CA

public static int OBJECT_SIGNING_CA
Indicates a certificate that is certified for issuing certs for Object Signing.
Constructor Detail

NetscapeCertType

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

Use the setCertType method for explicitly setting some particular certificate type(s), e.g.:

 NetscapeCertType netscapeCertType = new NetscapeCertType();
 netscapeCertType.setCertType(NetscapeCertType.SSL_CLIENT |
                              NetscapeCertType.SSL_SERVER);
 


NetscapeCertType

public NetscapeCertType(int type)
Constructs a NetscapeCertType extension with a specified type parameter.

For instance:

 NetscapeCertType netscapeCertType = new NetscapeCertType(NetscapeCertType.SSL_CLIENT |
                                                          NetscapeCertType.SSL_SERVER);
 

The following types are supported:

Parameters:
type - the usage type of the certificate
Method Detail

getObjectID

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

init

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

The ASN1Object represents a BIT STRING which specifies the particular type(s) of certificate usage.

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

toASN1Object

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

The returned ASN1Object represents a BIT STRING which specifies the particular type(s) of certificate usage.

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

setCertType

public void setCertType(int type)
Sets the usage type of the certificate.

For instance:

 NetscapeCertType netscapeCertType = new NetscapeCertType();
 netscapeCertType.setCertType(NetscapeCertType.SSL_CLIENT |
                              NetscapeCertType.SSL_SERVER);
 

The following types are supported:

Parameters:
type - the type of the certificate

getCertType

public int getCertType()
Returns the usage type value of the certificate as an integer.

Note the "little endian" representation of the BIT STRING representing the value of this NetscapeCertType extension: the most significant bit indicates the type with the lowest bit value, meaning that the integer value 128 (binary 10000000, hexadecimal 80) specifies the "SSL_CLIENT" type, and the integer value 1 specifies the "OBJECT_SIGNING_CA" type.

Returns:
the usage type value of the certificate, as int

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 NetscapeCertType 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