NPKIGetServerCertificates

Obtains the certificates in a specified certificate set on a given server and stores them in context-specific values (formerly NWPKIGetServerCertificates).

Syntax

    #include "npki.h"
    
    NWRCODE NPKIGetServerCertificates(
       const NPKIContext     context,
       const unicode        *serverDN,
       const unicode        *certificateName,
       const nuint32         flags,
       pnuint32              objectCertSize,
       nuint8 const        **objectCert,
       pnuint32              numberOfChainCerts,
       pnuint32              rootCertIndex,
       void                 *reserved1,
       void                 *reserved2);
    

Parameters

context
(IN) Specifies the NPKI context for the request.
serverDN
(IN) Points to the FDN of the eDirectory server whose certificates you want to obtain. This must be a valid eDirectory server in the current tree.
certificateName
(IN) Identifies which server certificate set you want to get.
flags
(IN) The flags field determines which certificates are read and stored. The following flags are currently defined:
  • PKI_CHAIN_CERTIFICATE—Retrieves the certificate chain.
  • PKI_TRUSTED_ROOT_CERTIFICATE—Retrieves the trusted root certificate.
  • PKI_OBJECT_KEY_CERTIFICATE—Retrieves the object certificate (that is, the certificate for the specified object).
  • PKI_CHAIN_CERTIFICATE and PKI_TRUSTED_ROOT_CERTIFICATE cannot be combined.
objectCertSize
(OUT) Specifies the size of the object certificate.
objectCert
(OUT) Points to the DER encoder X.509 object certificate.
numberOfChainCerts
(OUT) Specifies the number of certificates in the certificate chain. You can call NPKIChainCertInfo to retrieve the certificates in the certificate chain.
rootCertIndex
(OUT) Specifies which certificate in the certificate chain is marked as the root certificate.
reserved1
Reserved for future use.
reserved2
Reserved for future use.

Return Values

Returns 0 if successful, or an eDirectory, PKI, or NetWare error code if not successful.

Remarks

The flags field determines which certificates are read. NPKIGetServerCertificates and NPKIGetCACertificates use the same internal variables to store results, so calling one function right after calling the other causes data to be overwritten.

PKI NCP Calls

0x2222 93 05 PKI Get Certificate.

See Also

NPKIChainCertInfo, NPKICreateServerCertificate, NPKIFindServerCertificateNames, NPKIGetCACertificates, NPKIServerCertificateName, NPKIStoreServerCertificates, NPKIStoreServerCertificatesFromCertificateList