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
-
CRL_SIGN
-
-
CRL_SIGN_BIT
-
-
DATA_ENCIPHERMENT
-
-
DATA_ENCIPHERMENT_BIT
-
-
DECIPHER_ONLY
-
-
DECIPHER_ONLY_BIT
-
-
DIGITAL_SIGNATURE
-
-
DIGITAL_SIGNATURE_BIT
-
-
ENCIPHER_ONLY
-
-
ENCIPHER_ONLY_BIT
-
-
IDENT
- Identifier for this attribute, to be used with the
get, set, delete methods of Certificate, x509 type.
-
KEY_AGREEMENT
-
-
KEY_AGREEMENT_BIT
-
-
KEY_CERTSIGN
-
-
KEY_CERTSIGN_BIT
-
-
KEY_ENCIPHERMENT
-
-
KEY_ENCIPHERMENT_BIT
-
-
NAME
- Attribute names.
-
names
-
-
NBITS
-
-
NON_REPUDIATION
-
-
NON_REPUDIATION_BIT
-
-
KeyUsageExtension()
- Create a default key usage.
-
KeyUsageExtension(BitArray)
- Create a KeyUsageExtension with the passed bit settings.
-
KeyUsageExtension(Boolean, Object)
- Create the extension from the passed DER encoded value of the same.
-
KeyUsageExtension(boolean[])
- Create a KeyUsageExtension with the passed bit settings.
-
KeyUsageExtension(byte[])
- Create a KeyUsageExtension with the passed bit settings.
-
decode(InputStream)
- Decode the extension from the InputStream.
-
delete(String)
- Delete the attribute value.
-
encode(OutputStream)
- Write the extension to the DerOutputStream.
-
get(String)
- Get the attribute value.
-
getBits()
-
-
getElements()
- Return an enumeration of names of attributes existing within this
attribute.
-
getName()
- Return the name of this attribute.
-
set(String, Object)
- Set the attribute value.
-
toString()
- Returns a printable representation of the KeyUsage.
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.
DIGITAL_SIGNATURE
public static final String DIGITAL_SIGNATURE
NON_REPUDIATION
public static final String NON_REPUDIATION
KEY_ENCIPHERMENT
public static final String KEY_ENCIPHERMENT
DATA_ENCIPHERMENT
public static final String DATA_ENCIPHERMENT
KEY_AGREEMENT
public static final String KEY_AGREEMENT
KEY_CERTSIGN
public static final String KEY_CERTSIGN
CRL_SIGN
public static final String CRL_SIGN
ENCIPHER_ONLY
public static final String ENCIPHER_ONLY
DECIPHER_ONLY
public static final String DECIPHER_ONLY
DIGITAL_SIGNATURE_BIT
public static final int DIGITAL_SIGNATURE_BIT
NON_REPUDIATION_BIT
public static final int NON_REPUDIATION_BIT
KEY_ENCIPHERMENT_BIT
public static final int KEY_ENCIPHERMENT_BIT
DATA_ENCIPHERMENT_BIT
public static final int DATA_ENCIPHERMENT_BIT
KEY_AGREEMENT_BIT
public static final int KEY_AGREEMENT_BIT
KEY_CERTSIGN_BIT
public static final int KEY_CERTSIGN_BIT
CRL_SIGN_BIT
public static final int CRL_SIGN_BIT
ENCIPHER_ONLY_BIT
public static final int ENCIPHER_ONLY_BIT
DECIPHER_ONLY_BIT
public static final int DECIPHER_ONLY_BIT
NBITS
public static final int NBITS
names
public static String names[]
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.
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.
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.
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.
KeyUsageExtension
public KeyUsageExtension()
- Create a default key usage.
set
public void set(String name,
Object obj) throws IOException
- Set the attribute value.
get
public Object get(String name) throws IOException
- Get the attribute value.
delete
public void delete(String name) throws IOException
- Delete the attribute value.
toString
public String toString()
- Returns a printable representation of the KeyUsage.
- Overrides:
- toString in class Extension
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.
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.
getElements
public Enumeration getElements()
- Return an enumeration of names of attributes existing within this
attribute.
getBits
public boolean[] getBits()
getName
public String getName()
- Return the name of this attribute.
All Packages Class Hierarchy This Package Previous Next Index