NPKICertificateList
Stores a certificate (such as, X.509) or set of certificates (such as, PKCS #7) to an internal structure.
#include "npki.h" NWRCODE NPKICertificateList( const NPKIContext context, const pnuint8 certificate, const nuint32 certificateLen, const nuint32 flags, pnuint32 numberOfCertsInList);
Returns 0 if successful, or a PKI error code if not successful.
Each call to NPKICertificateList can store, remove, and/or sort the internal certificate chain structure. A subsequent call to NPKIStoreServerCertificatesFromCertificateList stores the chain of certificates to a Key Material Object (KMO).
When creating a server certificate in a multi-server environment for a server that does not host the CA, calling NPKICreateServerCertificate just creates the KMO (that is, it does not store the certificate or certificate chain). After a successful call to NPKICreateServerCertificate, call NPKICertInfo to get the object certificate that was just created. Call NPKICertificateList with the flag PKI_CLEAR_CERTS to make sure the internal certificate list is cleared.
Add the object certificate to the certificate list by calling NPKICertificateList and passing in the object certificate, object certificate length, and the flag PKI_ADD_CERT. Call NPKIGetCACertificates to get the self-signed certificate. Add this to the certificate list. When all certificates have been added and a complete chain has been assembled, call NPKIStoreServerCertificatesFromCertificateList to store the certificates in the list to the KMO.