com.ibm.security12.sun.security.x509
Class NetscapeCertTypeExtension

java.lang.Object
  |
  +--com.ibm.security12.sun.security.x509.Extension
        |
        +--com.ibm.security12.sun.security.x509.NetscapeCertTypeExtension

public class NetscapeCertTypeExtension
extends Extension
implements CertAttrSet

Represents Netscape Certificate Type Extension. The details are defined here .

This extension, if present, defines both the purpose (e.g., encipherment, signature, certificate signing) and the application (e.g., SSL, S/Mime or Object Signing of the key contained in the certificate. This extension has been superseded by IETF PKIX extensions but is provided here for compatibility reasons.

Version:
1.1
Author:
Hemma Prafullchandra
See Also:
Extension, CertAttrSet

Field Summary
static String IDENT
          Identifier for this attribute, to be used with the get, set, delete methods of Certificate, x509 type.
static String NAME
          Attribute names.
static ObjectIdentifier NetscapeCertType_Id
          Object identifier for the Netscape-Cert-Type extension.
static String OBJECT_SIGNING
           
static String OBJECT_SIGNING_CA
           
static String S_MIME
           
static String S_MIME_CA
           
static String SSL_CA
           
static String SSL_CLIENT
           
static String SSL_SERVER
           
 
Fields inherited from class com.ibm.security12.sun.security.x509.Extension
critical, extensionId, extensionValue
 
Constructor Summary
NetscapeCertTypeExtension()
          Create a default key usage.
NetscapeCertTypeExtension(boolean[] bitString)
          Create a NetscapeCertTypeExtension with the passed bit settings.
NetscapeCertTypeExtension(Boolean critical, Object value)
          Create the extension from the passed DER encoded value of the same.
NetscapeCertTypeExtension(byte[] bitString)
          Create a NetscapeCertTypeExtension with the passed bit settings.
 
Method Summary
 void decode(InputStream in)
          Decode the extension from the InputStream.
 void delete(String name)
          Delete the attribute value.
 void encode(OutputStream out)
          Write the extension to the DerOutputStream.
 Object get(String name)
          Get the attribute value.
 Enumeration getElements()
          Return an enumeration of names of attributes existing within this attribute.
 boolean[] getKeyUsageMappedBits()
          Get a boolean array representing the bits of this extension, as it maps to the KeyUsage extension.
 String getName()
          Return the name of this attribute.
 void set(String name, Object obj)
          Set the attribute value.
 String toString()
          Returns a printable representation of the NetscapeCertType.
 
Methods inherited from class com.ibm.security12.sun.security.x509.Extension
encode, equals, getExtensionId, getExtensionValue, hashCode, isCritical
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

IDENT

public static final String IDENT
Identifier for this attribute, to be used with the get, set, delete methods of Certificate, x509 type.

NAME

public static final String NAME
Attribute names.

SSL_CLIENT

public static final String SSL_CLIENT

SSL_SERVER

public static final String SSL_SERVER

S_MIME

public static final String S_MIME

OBJECT_SIGNING

public static final String OBJECT_SIGNING

SSL_CA

public static final String SSL_CA

S_MIME_CA

public static final String S_MIME_CA

OBJECT_SIGNING_CA

public static final String OBJECT_SIGNING_CA

NetscapeCertType_Id

public static final ObjectIdentifier NetscapeCertType_Id
Object identifier for the Netscape-Cert-Type extension.
Constructor Detail

NetscapeCertTypeExtension

public NetscapeCertTypeExtension(byte[] bitString)
                          throws IOException
Create a NetscapeCertTypeExtension with the passed bit settings. The criticality is set to true.
Parameters:
bitString - the bits to be set for the extension.

NetscapeCertTypeExtension

public NetscapeCertTypeExtension(boolean[] bitString)
                          throws IOException
Create a NetscapeCertTypeExtension with the passed bit settings. The criticality is set to true.
Parameters:
bitString - the bits to be set for the extension.

NetscapeCertTypeExtension

public NetscapeCertTypeExtension(Boolean critical,
                                 Object value)
                          throws IOException
Create the extension from the passed DER encoded value of the same.
Parameters:
critical - true if the extension is to be treated as critical.
value - Array of DER encoded bytes of the actual value.
Throws:
IOException - on error.

NetscapeCertTypeExtension

public NetscapeCertTypeExtension()
Create a default key usage.
Method Detail

set

public void set(String name,
                Object obj)
         throws IOException
Set the attribute value.
Specified by:
set in interface CertAttrSet

get

public Object get(String name)
           throws IOException
Get the attribute value.
Specified by:
get in interface CertAttrSet

delete

public void delete(String name)
            throws IOException
Delete the attribute value.
Specified by:
delete in interface CertAttrSet

toString

public String toString()
Returns a printable representation of the NetscapeCertType.
Specified by:
toString in interface CertAttrSet
Overrides:
toString in class Extension

decode

public void decode(InputStream in)
            throws IOException
Decode the extension from the InputStream.
Specified by:
decode in interface CertAttrSet
Parameters:
in - the InputStream to unmarshal the contents from.
Throws:
IOException - on decoding errors.

encode

public void encode(OutputStream out)
            throws IOException
Write the extension to the DerOutputStream.
Specified by:
encode in interface CertAttrSet
Parameters:
out - the DerOutputStream to write the extension to.
Throws:
IOException - on encoding errors.

getElements

public Enumeration getElements()
Return an enumeration of names of attributes existing within this attribute.
Specified by:
getElements in interface CertAttrSet

getName

public String getName()
Return the name of this attribute.
Specified by:
getName in interface CertAttrSet

getKeyUsageMappedBits

public boolean[] getKeyUsageMappedBits()
Get a boolean array representing the bits of this extension, as it maps to the KeyUsage extension.
Returns:
the bit values of this extension mapped to the bit values of the KeyUsage extension as an array of booleans.