Oracle Security Developer Tools Security Engine Java API Reference
10g (10.1.4.0.1)

B28175-01


oracle.security.crypto.cert.ext
Class KeyUsageExtension

java.lang.Object
  extended byoracle.security.crypto.cert.X509Extension
      extended byoracle.security.crypto.cert.ext.KeyUsageExtension

All Implemented Interfaces:
oracle.security.crypto.asn1.ASN1Object, oracle.security.crypto.util.Streamable

public class KeyUsageExtension
extends X509Extension

Represents the certificate Key Usage extension from RFC 2459. This extension SHOULD be critical.


Field Summary
static int CRL_SIGN
          Key usage flag to be used in setUsageFlag(int).
static int DATA_ENCIPHERMENT
          Key usage flag to be used in setUsageFlag(int).
static int DECIPHER_ONLY
          Key usage flag to be used in setUsageFlag(int).
static int DIGITAL_SIGNATURE
          Key usage flag to be used in setUsageFlag(int).
static int ENCIPHER_ONLY
          Key usage flag to be used in setUsageFlag(int).
static int KEY_AGREEMENT
          Key usage flag to be used in setUsageFlag(int).
static int KEY_CERT_SIGN
          Key usage flag to be used in setUsageFlag(int).
static int KEY_ENCIPHERMENT
          Key usage flag to be used in setUsageFlag(int).
static int NON_REPUDIATION
          Key usage flag to be used in setUsageFlag(int).

 

Fields inherited from class oracle.security.crypto.cert.X509Extension
id_netscape_ce, id_netscape_ce_type, id_set_ce, id_set_ce_type, isDecoded

 

Constructor Summary
KeyUsageExtension()
          Create a new extension with the appropriate OID type.
KeyUsageExtension(boolean critical)
          Creates a new extension with no key usage flags set.
KeyUsageExtension(java.io.InputStream is)
           
KeyUsageExtension(int[] flags, boolean critical)
          Creates a new extension with the given key usage flags set.

 

Method Summary
 void clearAllUsageFlags()
           
 void clearUsageFlag(int flag)
           
 boolean hasUsageFlag(int flag)
          Returns whether or not the given key usage flag is set.
 void setUsageFlag(int flag)
          Sets the given key usage flag.
 void setUsageFlags(int[] flags)
           
 java.lang.String toString()
          Returns a string representation of this object.

 

Methods inherited from class oracle.security.crypto.cert.X509Extension
getASN1Value, getCritical, getID, getType, getValue, input, input, inputInstance, isRecognized, length, output, setCritical, setValue

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Field Detail

DIGITAL_SIGNATURE

public static final int DIGITAL_SIGNATURE
Key usage flag to be used in setUsageFlag(int).
See Also:
Constant Field Values

NON_REPUDIATION

public static final int NON_REPUDIATION
Key usage flag to be used in setUsageFlag(int).
See Also:
Constant Field Values

KEY_ENCIPHERMENT

public static final int KEY_ENCIPHERMENT
Key usage flag to be used in setUsageFlag(int).
See Also:
Constant Field Values

DATA_ENCIPHERMENT

public static final int DATA_ENCIPHERMENT
Key usage flag to be used in setUsageFlag(int).
See Also:
Constant Field Values

KEY_AGREEMENT

public static final int KEY_AGREEMENT
Key usage flag to be used in setUsageFlag(int).
See Also:
Constant Field Values

KEY_CERT_SIGN

public static final int KEY_CERT_SIGN
Key usage flag to be used in setUsageFlag(int).
See Also:
Constant Field Values

CRL_SIGN

public static final int CRL_SIGN
Key usage flag to be used in setUsageFlag(int).
See Also:
Constant Field Values

ENCIPHER_ONLY

public static final int ENCIPHER_ONLY
Key usage flag to be used in setUsageFlag(int).
See Also:
Constant Field Values

DECIPHER_ONLY

public static final int DECIPHER_ONLY
Key usage flag to be used in setUsageFlag(int).
See Also:
Constant Field Values

Constructor Detail

KeyUsageExtension

public KeyUsageExtension()
Create a new extension with the appropriate OID type.

Note: An object created using this constructor may not be in a valid state. This constructor is intended primarily for use in conjunction with the X509Extension.input(java.io.InputStream) method.


KeyUsageExtension

public KeyUsageExtension(boolean critical)
Creates a new extension with no key usage flags set.
Parameters:
critical - true if this extension is critical, false otherwise.

KeyUsageExtension

public KeyUsageExtension(int[] flags,
                         boolean critical)
Creates a new extension with the given key usage flags set.
Parameters:
flags - an array of usage flag constants defined in this class.
critical - true if this extension is critical, false otherwise.

KeyUsageExtension

public KeyUsageExtension(java.io.InputStream is)
                  throws java.io.IOException

Method Detail

hasUsageFlag

public boolean hasUsageFlag(int flag)
Returns whether or not the given key usage flag is set.
Parameters:
flag - one of the key usage flag constants defined in this class.
Returns:
true if the flag is set, otherwise false.

setUsageFlag

public void setUsageFlag(int flag)
Sets the given key usage flag.
Parameters:
flag - one of the key usage flag constants defined in this class.

setUsageFlags

public void setUsageFlags(int[] flags)

clearUsageFlag

public void clearUsageFlag(int flag)

clearAllUsageFlags

public void clearAllUsageFlags()

toString

public java.lang.String toString()
Description copied from class: X509Extension
Returns a string representation of this object.
Overrides:
toString in class X509Extension
Returns:
a string representation

Oracle Security Developer Tools Security Engine Java API Reference
10g (10.1.4.0.1)

B28175-01


Copyright © 2005 ,2006 , Oracle. All rights reserved.