|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.novell.security.japi.pki.NPKIToolbox | +--com.novell.security.japi.pki.NPKITcache
Creates a cache which can be used to store PKI elements for example certificates, wrapped private keys, etc. The cache is stored on the local file system. The cache files are stored relative to the current working directory, unless a different path is specified.
Field Summary | |
static int |
NPKIT_NORMAL_FORMAT
Specifies that the element info should be returned in the normal or DER format. |
static int |
NPKIT_PEM_ASCII_NAME
Specifies the ASCII naming convention is to be used. |
static int |
NPKIT_PEM_FORMAT
Specifies that the element info should be returned in the PEM format. |
static int |
NPKIT_PEM_NORMAL_NAME
Specifies the default Unicode naming convention that is to be used. |
static int |
NPKIT_PEM_OVERWRITE_FILE
Specifies that existing cache files should be overwritten. |
Constructor Summary | |
NPKITcache()
Constructor. |
Method Summary | |
void |
addElement(int elementType,
byte[] data)
Adds a cache element of type elementType to the context. |
void |
addPKCS12Elements(java.lang.String password,
byte[] pfx,
java.lang.Integer numberOfElementsAdded)
Adds all the elements in the PKCS#12 data to the context. |
void |
clearAllElements()
Clears all elements from a cache context |
void |
createContext()
Creates a new NPKIT cache context and initializes it with default values. |
int |
elementInfo(int index,
byte[][] data)
Retreives information about the specified cache element |
int |
elementInfo(int flags,
int index,
byte[][] data)
Retreives information about the specified cache element |
void |
freeContext()
Frees a previously allocated NPKIT cache context and all associated memory |
int |
getContextHandle()
|
void |
initialize()
Initializes NPKITcache. |
int |
read(int flags,
java.lang.String name,
java.lang.String path)
Reads the specified cache file |
void |
write(int flags,
java.lang.String name,
java.lang.String path)
Writes all the cache elements in the cache context to the specfied cache file |
Methods inherited from class com.novell.security.japi.pki.NPKIToolbox |
decodeCSR, destroy, finalize, getUTCString, loadLibrary, version |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NPKIT_PEM_NORMAL_NAME
(NPKIT_PEM_NORMAL_NAME = 0)
public static final int NPKIT_PEM_ASCII_NAME
(NPKIT_PEM_ASCII_NAME = 1)
public static final int NPKIT_PEM_OVERWRITE_FILE
(NPKIT_PEM_OVERWRITE_FILE = 100)
public static final int NPKIT_NORMAL_FORMAT
(NPKIT_NORMAL_FORMAT = 0)
public static final int NPKIT_PEM_FORMAT
(NPKIT_PEM_FORMAT = 1)
Constructor Detail |
public NPKITcache() throws NPKI_Exception
NPKI_Exception
- Throws a PKI error code if not successful.Method Detail |
public void initialize() throws NPKI_Exception
initialize
in class NPKIToolbox
NPKI_Exception
- Throws a PKI error code if not successful.public int getContextHandle()
public void createContext() throws NPKI_Exception
createContext
in class NPKIToolbox
NPKI_Exception
- Throws a PKI error code if not successful.freeContext
public void freeContext()
freeContext
in class NPKIToolbox
createContext
public void clearAllElements()
createContext
,
addElement
public void addElement(int elementType, byte[] data) throws NPKI_Exception
elementType
- Specifies the type of element to be added.data
- Specifies the data to be added.
NPKI_Exception
- Throws a PKI error code if not successful.createContext
,
write
public void addPKCS12Elements(java.lang.String password, byte[] pfx, java.lang.Integer numberOfElementsAdded) throws NPKI_Exception
password
- Specifioes the password used to decrypt the PKCS12 data.pfx
- Specifies the PFX (or PKCS#12) data.numberOfElementsAdded
- Returns the number of elements that were added to the cache.
NPKI_Exception
- Throws a NICI or PKI error code if not successful.createContext
,
addElement
,
write
public int elementInfo(int index, byte[][] data) throws NPKI_Exception
index
- Specifies which cache element to get information from.data
- Returns the data from the specified cache element.
NPKI_Exception
- Throws a PKI error code if not successful.createContext
,
addElement
,
read
public int elementInfo(int flags, int index, byte[][] data) throws NPKI_Exception
flags
- Specifies which format the element data will be returned in. Use one of the following:NPKIT_NORMAL_FORMAT
- Specifies that the element info should be
returned in the normal or DER format.
NPKIT_PEM_FORMAT
- Specifies that the element info should be
returned in PEM format.index
- Specifies which cache element to get information from.data
- Returns the data from the specified cache element.
NPKI_Exception
- Throws a PKI error code if not successful.createContext
,
addElement
,
read
public void write(int flags, java.lang.String name, java.lang.String path) throws NPKI_Exception
flags
- Specifies options for writing the cache file. The three
possible flags and their behavior are listed below:NPKIT_PEM_NORMAL_NAME
- Using the flag NPKIT_PEM_NORMAL_NAME
indicates that
the paramater name
is to be interperted as a unicode string.
NPKIT_PEM_ASCII_NAME
- Using the flag NPKIT_PEM_ASCII_NAME
indicates that
the paramater name
is to be interperted as an ASCII string.
NPKIT_PEM_OVERWRITE_FILE
- Using the flag NPKIT_PEM_OVERWRITE_FILE
specifies
that existing cache files with the same name should be overwritten. This flag may be bitwise-OR'ed with either
of the two other flags.name
- Specifies the name of the cache file.path
- (Optional) If used, specifies the file path to use when writing the cache file.
NPKI_Exception
- Throws a PKI or file system error code if not successful.createContext
,
clearAllElements
,
addElement
public int read(int flags, java.lang.String name, java.lang.String path) throws NPKI_Exception
flags
- Specifies options for reading the cache file. The two valid flags and their behavior are listed below:NPKIT_PEM_NORMAL_NAME
- Using the flag NPKIT_PEM_NORMAL_NAME
indicates that
the paramater name
is to be interperted as a unicode string.
NPKIT_PEM_ASCII_NAME
- Using the flag NPKIT_PEM_ASCII_NAME
indicates that
the paramater name
is to be interperted as an ASCII string.name
- Specifies the name of the cache file.path
- (Optional) If used, specifies the file path to use when reading the cache file.
NPKI_Exception
- Throws a PKI or file system error code if not successful.createContext
,
clearAllElements
,
elementInfo
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |