com.novell.security.japi.pki
Class NPKI_Extension

java.lang.Object
  |
  +--com.novell.security.japi.pki.NPKI_Extension

public class NPKI_Extension
extends java.lang.Object

Specifies any generic ASN.1 encoded extensions to add during the creation of server and user certificates.

NOTE: Each extension must be a fully ASN.1 encoded extension conforming to RFC 2459.


Field Summary
protected  int m_flags
           
protected  int m_length
           
protected  byte[] m_value
           
 
Constructor Summary
NPKI_Extension(int flags)
          Default constructor used to denote how the extension will be encoded in the certificate and is composed of both general purpose flags combined with any extension specific flags if necessary.
NPKI_Extension(int flags, byte[] value)
          Constructor, sets flags and structures for certificate extensions.
NPKI_Extension(int flags, int value)
          Constructor used to sets flags and structures for certificate extensions.
NPKI_Extension(int flags, long value)
          Constructor, sets flags and structures for certificate extensions.
NPKI_Extension(int flags, short value)
          Constructor, sets flags and structures for certificate extensions.
NPKI_Extension(int flags, java.lang.String value)
          Constructor, sets flags and structures for certificate extensions.
 
Method Summary
 byte[] getByteArray()
          Gets the certificate extension.
 int getFlags()
          Gets flags used to define certificate extensions.
 int getLength()
          Gets the length of the extension.
 void setFlags(int flags)
          Sets extension flags.
 void setValue(byte[] value)
          Sets the extension.
 void setValue(int value)
          Sets the extension.
 void setValue(long value)
          Sets the extension.
 void setValue(short value)
          Sets the extension.
 void setValue(java.lang.String value)
          Sets the extension.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_flags

protected int m_flags

m_length

protected int m_length

m_value

protected byte[] m_value
Constructor Detail

NPKI_Extension

public NPKI_Extension(int flags)
Default constructor used to denote how the extension will be encoded in the certificate and is composed of both general purpose flags combined with any extension specific flags if necessary.

Parameters:
flags - Sets extenstion flags.

NPKI_Extension

public NPKI_Extension(int flags,
                      short value)
               throws java.io.IOException
Constructor, sets flags and structures for certificate extensions.

Parameters:
flags - Denotes how the extension will be encoded in the certificate and is composed of both general purpose flags combined with any extension specific flags if necessary.
value - A two byte extension.
Throws:
java.io.IOException - if an I/O error occurs.

NPKI_Extension

public NPKI_Extension(int flags,
                      int value)
               throws java.io.IOException
Constructor used to sets flags and structures for certificate extensions.

Parameters:
flags - Denotes how the extension will be encoded in the certificate and is composed of both general purpose flags combined with any extension specific flags if necessary.
value - A four byte extension.
Throws:
java.io.IOException - if an I/O error occurs.

NPKI_Extension

public NPKI_Extension(int flags,
                      long value)
               throws java.io.IOException
Constructor, sets flags and structures for certificate extensions.

Parameters:
flags - Denotes how the extension will be encoded in the certificate and is composed of both general purpose flags combined with any extension specific flags if necessary.
value - An eight byte extension.
Throws:
java.io.IOException - if an I/O error occurs.

NPKI_Extension

public NPKI_Extension(int flags,
                      java.lang.String value)
               throws java.io.IOException
Constructor, sets flags and structures for certificate extensions.

Parameters:
flags - Denotes how the extension will be encoded in the certificate and is composed of both general purpose flags combined with any extension specific flags if necessary.
value - A multi-byte extension in string format.
Throws:
java.io.IOException - if an I/O error occurs.

NPKI_Extension

public NPKI_Extension(int flags,
                      byte[] value)
               throws java.io.IOException
Constructor, sets flags and structures for certificate extensions.

Parameters:
flags - Denotes how the extension will be encoded in the certificate and is composed of both general purpose flags combined with any extension specific flags if necessary.
value - A multi-byte extension.
Throws:
java.io.IOException - if an I/O error occurs.
Method Detail

setFlags

public void setFlags(int flags)
Sets extension flags.

Parameters:
flags - Extension flags for the current extension

setValue

public void setValue(short value)
              throws java.io.IOException
Sets the extension.

Parameters:
value - A two byte extension
Throws:
java.io.IOException - if an I/O error occurs.

setValue

public void setValue(int value)
              throws java.io.IOException
Sets the extension.

Parameters:
value - A four byte extension
Throws:
java.io.IOException - if an I/O error occurs.

setValue

public void setValue(long value)
              throws java.io.IOException
Sets the extension.

Parameters:
value - An eight byte extension
Throws:
java.io.IOException - if an I/O error occurs.

setValue

public void setValue(java.lang.String value)
              throws java.io.IOException
Sets the extension.

Parameters:
value - A multi-byte extension in String format
Throws:
java.io.IOException - if an I/O error occurs.

setValue

public void setValue(byte[] value)
              throws java.io.IOException
Sets the extension.

Parameters:
value - A multi-byte extension
Throws:
java.io.IOException - if an I/O error occurs.

getFlags

public int getFlags()
Gets flags used to define certificate extensions.

Returns:
Extension flags

getLength

public int getLength()
Gets the length of the extension.

Returns:
Length of extension in bytes.

getByteArray

public byte[] getByteArray()
Gets the certificate extension.

Returns:
Extension in byte format