com.novell.security.japi.pki
Class NPKITx509CertList

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

public class NPKITx509CertList
extends NPKIToolbox

Manages an X.509 certificate list.


Field Summary
static int NPKIT_ADD_CERT
          Specifies that the certificate(s) are to be added.
static int NPKIT_CLEAR_CERTS
          Specifies that all certificates are to be deleted.
static int NPKIT_DEL_CERT
          Specifies that the certificate is to be deleted.
static int NPKIT_SORT_LIST
          Specifies that the certificate list is to be sorted.
 
Constructor Summary
NPKITx509CertList()
          Constructor.
 
Method Summary
 void createContext()
          Creates a new NPKITx509CertList context structure and initializes it with default values.
 void freeContext()
          Frees a previously allocated NPKITx509CertList context and all associated memory.
 void initialize()
          Initializes NPKITx509CertList.
 byte[] x509CertListGetCertInfo(int index)
          Returns the specified X.509 Certificate from the list.
 void x509CertListGetListInfo(java.lang.Integer numberOfCertsInList)
          Returns information about an X.509 Certificate List
 int x509CertListModify(int flags, byte[] certificate)
          Stores a certificate (such as, X.509) or set of certificates (such as, PKCS #7) to the certificate list.
 
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

NPKIT_CLEAR_CERTS

public static final int NPKIT_CLEAR_CERTS
Specifies that all certificates are to be deleted.

(NPKIT_CLEAR_CERTS = 0x01)

See Also:
Constant Field Values

NPKIT_ADD_CERT

public static final int NPKIT_ADD_CERT
Specifies that the certificate(s) are to be added.

(NPKIT_ADD_CERT = 0x02)

See Also:
Constant Field Values

NPKIT_DEL_CERT

public static final int NPKIT_DEL_CERT
Specifies that the certificate is to be deleted.

(NPKIT_DEL_CERT = 0x04)

See Also:
Constant Field Values

NPKIT_SORT_LIST

public static final int NPKIT_SORT_LIST
Specifies that the certificate list is to be sorted.

(NPKIT_SORT_LIST = 0x10)

See Also:
Constant Field Values
Constructor Detail

NPKITx509CertList

public NPKITx509CertList()
                  throws NPKI_Exception
Constructor.

Throws:
NPKI_Exception - Throws a NICI or PKI error code if not successful.
Method Detail

initialize

public void initialize()
                throws NPKI_Exception
Initializes NPKITx509CertList.

Overrides:
initialize in class NPKIToolbox
Throws:
NPKI_Exception - Throws a PKI error code if not successful.

createContext

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

The context will be used for handling a list of X.509 certificates.

Specified by:
createContext in class NPKIToolbox
Throws:
NPKI_Exception - Throws a PKI error code if not successful.
See Also:
freeContext

freeContext

public void freeContext()
Frees a previously allocated NPKITx509CertList context and all associated memory.

Specified by:
freeContext in class NPKIToolbox
See Also:
createContext

x509CertListGetListInfo

public void x509CertListGetListInfo(java.lang.Integer numberOfCertsInList)
                             throws NPKI_Exception
Returns information about an X.509 Certificate List

Parameters:
numberOfCertsInList - (OUT) Indicates how many certificates are in the list.

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

x509CertListGetCertInfo

public byte[] x509CertListGetCertInfo(int index)
                               throws NPKI_Exception
Returns the specified X.509 Certificate from the list.

Parameters:
index - (IN) Specifies which certificate to get.

Returns:
the X.509 certificate.
Throws:
NPKI_Exception - Throws a PKI error code if not successful.

x509CertListModify

public int x509CertListModify(int flags,
                              byte[] certificate)
                       throws NPKI_Exception
Stores a certificate (such as, X.509) or set of certificates (such as, PKCS #7) to the certificate list. Each call to x509CertListModify can store, remove, and/or sort the internal certificate list.

Parameters:
flags - Specifies which operation is to be performed. The possible operations are listed below:
  • NPKIT_CLEAR_CERTS - Using the flag NPKIT_CLEAR_CERTS will cause all certificates in the list to be deleted. The field certificate is ignored.
  • NPKIT_ADD_CERT - Using the flag NPKIT_ADD_CERT will cause the specified certificate(s) to be added to the list.
  • NPKIT_DEL_CERT - Using the flag NPKIT_DEL_CERT will cause the specified certificate to be deleted from the list.
  • NPKIT_SORT_LIST - Using the flag NPKIT_SORT_LIST will cause the list to be sorted. This flag can be or'ed with any of the other flags.
certificate - Specifies the certificate(s) to be modified. When deleting this should be a DER enocoded X.509 certificate. When adding, this may be either a DER enocoded X.509 or a PKCS#7 set of certificates.
Returns:
the number of certificates currently in the list (after the modify operation is performed).
Throws:
NPKI_Exception - Throws a PKI error code if not successful.