com.novell.security.japi.pki
Class NPKIToolbox

java.lang.Object
  |
  +--com.novell.security.japi.pki.NPKIToolbox
Direct Known Subclasses:
NPKITcache, NPKITcertificate, NPKITcrl, NPKITverify, NPKITx509, NPKITx509CertList

public abstract class NPKIToolbox
extends java.lang.Object

Provides the Java interface for NPKIT, the public key infrastructure (PKI) services to manage and access X.509 certificates.

This API helps to further enhance or customize your security solutions without re-writing your own technology.

NOTE: This library requires the cryptography services of Novell International Cryptographic Infrastructure (NICI) and the LDAP SDK. NICI is the underlying cryptographic infrastructure that provides the cryptography for Novell PKI Toolbox and other Novell applications. Novell PKI Toolbox will not function if cryptography services and the LDAP SDK are not fully installed.

NICI availability and cryptography strength is restricted if your network is located in an entity listed on the U.S. Government Restricted Party List or in a country with import controls on cryptography products or technologies. Further developer information on NICI functionality may be accessed at NICI Encryption Modules.


Constructor Summary
NPKIToolbox()
           
 
Method Summary
abstract  void createContext()
          Creates a new PKI context structure and initializes it with default values.
 void decodeCSR(byte[] csr, java.lang.Integer csrVersion, java.lang.String[] subjectName, java.lang.Integer keyAlgorithmType, java.lang.String[] keyAlgorithmOID, byte[][] keyModulus, byte[][] keyExponent, java.lang.Integer keySize, java.lang.Integer sigAlgType, java.lang.String[] sigAlgOID)
          API used for decoding a CSR (PKCS#10).
 void destroy()
          Frees the current context.
 void finalize()
          Clean up.
abstract  void freeContext()
          Frees a previously allocated NPKI context and all associated memory.
 java.lang.String getUTCString(java.lang.Integer time)
          Returns the time according to UTC (Universal Time Coordinated) as a string.
protected  void initialize()
          Initializes the PKI context.
protected  void loadLibrary()
          Loads the programmatic libraries and classes necessary to implement PKI services.
 int version()
          Returns the version of the NPKIT library being used.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NPKIToolbox

public NPKIToolbox()
Method Detail

createContext

public abstract void createContext()
                            throws NPKI_Exception
Creates a new PKI context structure and initializes it with default values.

Throws:
NPKI_Exception - Throws a PKI error code if not successful.
See Also:
freeContext, destroy

freeContext

public abstract void freeContext()
                          throws NPKI_Exception
Frees a previously allocated NPKI context and all associated memory.

Throws:
NPKI_Exception - If there was an error freeing the context
See Also:
createContext

initialize

protected void initialize()
                   throws NPKI_Exception
Initializes the PKI context.

This function must be called to instantiate PKI services.

Throws:
NPKI_Exception - Throws a PKI error code if not successful.

destroy

public void destroy()
Frees the current context. This is automatically called when the object is freed.


finalize

public void finalize()
              throws java.lang.Throwable
Clean up. Called whenever the instance of this class is freed or falls out of scope.

Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable - If there are any problems during clean up.

loadLibrary

protected void loadLibrary()
                    throws NPKI_Exception
Loads the programmatic libraries and classes necessary to implement PKI services.

Throws:
NPKI_Exception - If the libraries failed to load.

version

public int version()
            throws NPKI_Exception
Returns the version of the NPKIT library being used.

Returns:
Gets the installed version of NPKIT.
Throws:
NPKI_Exception - If the library is not loaded or does not implement this function.

getUTCString

public java.lang.String getUTCString(java.lang.Integer time)
Returns the time according to UTC (Universal Time Coordinated) as a string.

Parameters:
time - Integer representation of time in the number of seconds since 00:00:00 UTC January 1, 1970.
Returns:
Date in string format.

decodeCSR

public void decodeCSR(byte[] csr,
                      java.lang.Integer csrVersion,
                      java.lang.String[] subjectName,
                      java.lang.Integer keyAlgorithmType,
                      java.lang.String[] keyAlgorithmOID,
                      byte[][] keyModulus,
                      byte[][] keyExponent,
                      java.lang.Integer keySize,
                      java.lang.Integer sigAlgType,
                      java.lang.String[] sigAlgOID)
               throws NPKI_Exception
API used for decoding a CSR (PKCS#10).

Parameters:
csr - (IN) a DER encoded certificate signing request (CSR).
csrVersion - (OUT) Version of the CSR.
subjectName - (OUT) Requested Subject name.
keyAlgorithmType - (OUT) Algorithm used in the signature.
keyAlgorithmOID - (OUT) String that has a human-readable form of the signature key algorithm OID (i.e., {1 2 840 113549 1 1 1}).
keyModulus - (OUT) The key modulus.
keyExponent - (OUT) The key exponent.
keySize - (OUT) Identifies the requested size of the key ot be generated. If the key size requested cannot be generated, an error will be returned by the server and no key will be generated.
sigAlgType - (OUT) A bit mask indicating which signing algorithms are available on the server.
sigAlgOID - (OUT) Specifies a signature algorithm OID to use to sign the certificate, rather than using the signature algorithm in the CSR.
Throws:
NPKI_Exception - Throws a PKI error code if not successful.