All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class netscape.security.x509.KeyUsageExtension

netscape.security.x509.Extension
   |
   +----netscape.security.x509.KeyUsageExtension

public class KeyUsageExtension
extends Extension
implements CertAttrSet
Represent the Key Usage Extension.

This extension, if present, defines the purpose (e.g., encipherment, signature, certificate signing) of the key contained in the certificate. The usage restriction might be employed when a multipurpose key is to be restricted (e.g., when an RSA key should be used only for signing or only for key encipherment).

See Also:
Extension, CertAttrSet

Variable Index

 o CRL_SIGN
 o CRL_SIGN_BIT
 o DATA_ENCIPHERMENT
 o DATA_ENCIPHERMENT_BIT
 o DECIPHER_ONLY
 o DECIPHER_ONLY_BIT
 o DIGITAL_SIGNATURE
 o DIGITAL_SIGNATURE_BIT
 o ENCIPHER_ONLY
 o ENCIPHER_ONLY_BIT
 o IDENT
Identifier for this attribute, to be used with the get, set, delete methods of Certificate, x509 type.
 o KEY_AGREEMENT
 o KEY_AGREEMENT_BIT
 o KEY_CERTSIGN
 o KEY_CERTSIGN_BIT
 o KEY_ENCIPHERMENT
 o KEY_ENCIPHERMENT_BIT
 o NAME
Attribute names.
 o names
 o NBITS
 o NON_REPUDIATION
 o NON_REPUDIATION_BIT

Constructor Index

 o KeyUsageExtension()
Create a default key usage.
 o KeyUsageExtension(BitArray)
Create a KeyUsageExtension with the passed bit settings.
 o KeyUsageExtension(Boolean, Object)
Create the extension from the passed DER encoded value of the same.
 o KeyUsageExtension(boolean[])
Create a KeyUsageExtension with the passed bit settings.
 o KeyUsageExtension(byte[])
Create a KeyUsageExtension with the passed bit settings.

Method Index

 o decode(InputStream)
Decode the extension from the InputStream.
 o delete(String)
Delete the attribute value.
 o encode(OutputStream)
Write the extension to the DerOutputStream.
 o get(String)
Get the attribute value.
 o getBits()
 o getElements()
Return an enumeration of names of attributes existing within this attribute.
 o getName()
Return the name of this attribute.
 o set(String, Object)
Set the attribute value.
 o toString()
Returns a printable representation of the KeyUsage.

Variables

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

 o NAME
 public static final String NAME
Attribute names.

 o DIGITAL_SIGNATURE
 public static final String DIGITAL_SIGNATURE
 o NON_REPUDIATION
 public static final String NON_REPUDIATION
 o KEY_ENCIPHERMENT
 public static final String KEY_ENCIPHERMENT
 o DATA_ENCIPHERMENT
 public static final String DATA_ENCIPHERMENT
 o KEY_AGREEMENT
 public static final String KEY_AGREEMENT
 o KEY_CERTSIGN
 public static final String KEY_CERTSIGN
 o CRL_SIGN
 public static final String CRL_SIGN
 o ENCIPHER_ONLY
 public static final String ENCIPHER_ONLY
 o DECIPHER_ONLY
 public static final String DECIPHER_ONLY
 o DIGITAL_SIGNATURE_BIT
 public static final int DIGITAL_SIGNATURE_BIT
 o NON_REPUDIATION_BIT
 public static final int NON_REPUDIATION_BIT
 o KEY_ENCIPHERMENT_BIT
 public static final int KEY_ENCIPHERMENT_BIT
 o DATA_ENCIPHERMENT_BIT
 public static final int DATA_ENCIPHERMENT_BIT
 o KEY_AGREEMENT_BIT
 public static final int KEY_AGREEMENT_BIT
 o KEY_CERTSIGN_BIT
 public static final int KEY_CERTSIGN_BIT
 o CRL_SIGN_BIT
 public static final int CRL_SIGN_BIT
 o ENCIPHER_ONLY_BIT
 public static final int ENCIPHER_ONLY_BIT
 o DECIPHER_ONLY_BIT
 public static final int DECIPHER_ONLY_BIT
 o NBITS
 public static final int NBITS
 o names
 public static String names[]

Constructors

 o KeyUsageExtension
 public KeyUsageExtension(byte bitString[]) throws IOException
Create a KeyUsageExtension with the passed bit settings. The criticality is set to true.

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

Parameters:
bitString - the bits to be set for the extension.
 o KeyUsageExtension
 public KeyUsageExtension(BitArray bitString) throws IOException
Create a KeyUsageExtension with the passed bit settings. The criticality is set to true.

Parameters:
bitString - the bits to be set for the extension.
 o KeyUsageExtension
 public KeyUsageExtension(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.
 o KeyUsageExtension
 public KeyUsageExtension()
Create a default key usage.

Methods

 o set
 public void set(String name,
                 Object obj) throws IOException
Set the attribute value.

 o get
 public Object get(String name) throws IOException
Get the attribute value.

 o delete
 public void delete(String name) throws IOException
Delete the attribute value.

 o toString
 public String toString()
Returns a printable representation of the KeyUsage.

Overrides:
toString in class Extension
 o decode
 public void decode(InputStream in) throws IOException
Decode the extension from the InputStream.

Parameters:
in - the InputStream to unmarshal the contents from.
Throws: IOException
on decoding or validity errors.
 o encode
 public void encode(OutputStream out) throws IOException
Write the extension to the DerOutputStream.

Parameters:
out - the DerOutputStream to write the extension to.
Throws: IOException
on encoding errors.
 o getElements
 public Enumeration getElements()
Return an enumeration of names of attributes existing within this attribute.

 o getBits
 public boolean[] getBits()
 o getName
 public String getName()
Return the name of this attribute.


All Packages  Class Hierarchy  This Package  Previous  Next  Index