APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.security.x509

public Class NetscapeCertTypeExtension

extends Extension
Class Inheritance
Imports
java.io.IOException, sun.security.util.*

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.

Author
Hemma Prafullchandra
See Also
Extension

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private boolean[]
private static final NetscapeCertTypeExtension.MapEntry[]
public static final String
public static ObjectIdentifier
NetscapeCertType_Id

Object identifier for the Netscape-Cert-Type extension.

public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
Inherited from sun.security.x509.Extension:
criticalextensionIdextensionValue

Constructor Summary

AccessConstructor and Description
public
NetscapeCertTypeExtension(byte[]
the bits to be set for the extension.
bitString
)

Create a NetscapeCertTypeExtension with the passed bit settings.

public
NetscapeCertTypeExtension(boolean[]
the bits to be set for the extension.
bitString
)

Create a NetscapeCertTypeExtension with the passed bit settings.

public
NetscapeCertTypeExtension(Boolean
true if the extension is to be treated as critical.
critical
,
Object
an array of DER encoded bytes of the actual value.
value
)

Create the extension from the passed DER encoded value of the same.

public
NetscapeCertTypeExtension()

Create a default key usage.

Method Summary

Modifier and TypeMethod and Description
public void
encode(DerOutputStream
the DerOutputStream to write the extension to.
out
)

Overrides sun.security.x509.Extension.encode.

Implements sun.security.util.DerEncoder.encode.

Write the extension to the DerOutputStream.

private void
public boolean
get(String name)

Get the attribute value.

public boolean[]

Returns:

the bit values of this extension mapped to the bit values of the KeyUsage extension as an array of booleans.
getKeyUsageMappedBits
()

Get a boolean array representing the bits of this extension, as it maps to the KeyUsage extension.

public String
getName()

Overrides sun.security.x509.Extension.getName.

Return the name of this extension.

private static int
private boolean
isSet(int
the position in the bit string to check.
position
)

Check if bit is set.

private void
set(int position, boolean val)

Set the bit at the specified position.

public void
set(String name, Boolean val)

Set the attribute value.

public String
toString()

Overrides sun.security.x509.Extension.toString.

Returns a printable representation of the NetscapeCertType.

Inherited from sun.security.x509.Extension:
encodeequalsgetExtensionIdgetExtensionValuegetIdgetValuehashCodeisCriticalnewExtension

Field Detail

bitStringback to summary
private boolean[] bitString
mMapDataback to summary
private static final NetscapeCertTypeExtension.MapEntry[] mMapData
NAMEback to summary
public static final String NAME
NetscapeCertType_Idback to summary
public static ObjectIdentifier NetscapeCertType_Id

Object identifier for the Netscape-Cert-Type extension.

OBJECT_SIGNINGback to summary
public static final String OBJECT_SIGNING
OBJECT_SIGNING_CAback to summary
public static final String OBJECT_SIGNING_CA
S_MIMEback to summary
public static final String S_MIME
S_MIME_CAback to summary
public static final String S_MIME_CA
SSL_CAback to summary
public static final String SSL_CA
SSL_CLIENTback to summary
public static final String SSL_CLIENT
SSL_SERVERback to summary
public static final String SSL_SERVER

Constructor Detail

NetscapeCertTypeExtensionback to summary
public NetscapeCertTypeExtension(byte[] bitString)

Create a NetscapeCertTypeExtension with the passed bit settings. The criticality is set to true.

Parameters
bitString:byte[]

the bits to be set for the extension.

NetscapeCertTypeExtensionback to summary
public NetscapeCertTypeExtension(boolean[] bitString)

Create a NetscapeCertTypeExtension with the passed bit settings. The criticality is set to true.

Parameters
bitString:boolean[]

the bits to be set for the extension.

NetscapeCertTypeExtensionback to summary
public NetscapeCertTypeExtension(Boolean critical, Object value) throws IOException

Create the extension from the passed DER encoded value of the same.

Parameters
critical:Boolean

true if the extension is to be treated as critical.

value:Object

an array of DER encoded bytes of the actual value.

Exceptions
IOException:
on error.
ClassCastException:
if value is not an array of bytes
NetscapeCertTypeExtensionback to summary
public NetscapeCertTypeExtension()

Create a default key usage.

Method Detail

encodeback to summary
public void encode(DerOutputStream out)

Overrides sun.security.x509.Extension.encode.

Implements sun.security.util.DerEncoder.encode.

Write the extension to the DerOutputStream.

Parameters
out:DerOutputStream

the DerOutputStream to write the extension to.

Annotations
@Override
encodeThisback to summary
private void encodeThis()
getback to summary
public boolean get(String name) throws IOException

Get the attribute value.

getKeyUsageMappedBitsback to summary
public boolean[] getKeyUsageMappedBits()

Get a boolean array representing the bits of this extension, as it maps to the KeyUsage extension.

Returns:boolean[]

the bit values of this extension mapped to the bit values of the KeyUsage extension as an array of booleans.

getNameback to summary
public String getName()

Overrides sun.security.x509.Extension.getName.

Return the name of this extension.

Annotations
@Override
getPositionback to summary
private static int getPosition(String name) throws IOException
isSetback to summary
private boolean isSet(int position)

Check if bit is set.

Parameters
position:int

the position in the bit string to check.

setback to summary
private void set(int position, boolean val)

Set the bit at the specified position.

setback to summary
public void set(String name, Boolean val) throws IOException

Set the attribute value.

toStringback to summary
public String toString()

Overrides sun.security.x509.Extension.toString.

Returns a printable representation of the NetscapeCertType.

sun.security.x509 back to summary

private Class NetscapeCertTypeExtension.MapEntry

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv String
pack-priv int

Constructor Summary

AccessConstructor and Description
pack-priv
MapEntry(String name, int position)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mNameback to summary
pack-priv String mName
mPositionback to summary
pack-priv int mPosition

Constructor Detail

MapEntryback to summary
pack-priv MapEntry(String name, int position)