NPKIExportServerKey

Exports a server’s private key and corresponding certificates in Personal Information Exchange Syntax (PFX) format (formerly NWPKIExportServerKey).

Syntax

    #include "npki.h"
    
    void NPKIExportServerKey(
       const NPKIContext              context,
       const unicode                 *serverDN,
       const unicode                 *certificateName,
       const unicode                 *password,
       const nuint32                  flags,
       pnuint32 const                 pfxSize,
       nuint8 const                  **pfx);
    

Parameters

context
(IN) Specifies the NPKI context for the request.
serverDN
(IN) Specifies the FDN of the eDirectory server whose private key and certificates you want to export. This must be a valid eDirectory server in the current tree.
certificateName
(IN) Specifies which private key and certificates you want to export. It must be a valid certificate name for the specified server.
password
(IN) Specifies the password to use to encrypt the private key and certificate.
flags
(IN) Specifies options for exporting the server key and certificates (see Section 4.9, NPKIExportServerKey Flags). The flags currently defined are:PKI_CHAIN_CERTIFICATE—Exports the chain of certificates in the certification path along with the specified server certificate.
pfxSize
(OUT) Specifies the size of the exported data PFX.
pfx
(OUT) Points to the PKCS #12 encoded data.

Return Values

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

PKI NCP Calls

0x2222 93 09 Read Key

Remarks

The key and certificate are encrypted using the input password as specified in the Public Key Cryptography Standards (PKCS) #12.

See Also

NPKIImportServerKey