NPKIStoreUserCertificate

Stores a certificate on a user object (formerly NWPKIStoreUserCertificate).

Syntax

    #include "npki.h"
    
    NWRCODE NPKIStoreUserCertificate(
       const NPKIContext    context, 
       const unicode       *userDN,
       const unicode       *nickName,
       const unicode       *signerDN,
       const nuint32        flags,
       const pnuint8        cert,
       const nuint32        certSize,
       const nuint32        vendorID, 
       const pnuint8        privateKey,
       const nuint32        privateKeySize,
       void                *reserved1,
       void                *reserved2); 
    

Parameters

context
(IN) Specifies the NPKI context for the request.
userDN
(IN) Specifies the FDN of a User object. This must be a valid eDirectory user object in the current tree.
nickName
(IN) Specifies the certificate nickname. This name is used to identify the key pair and associated certificate. This name must be unique for the specified user.
signerDN
(IN) Specifies the FDN of the eDirectory object that signed the certificate.

If the certificate is an external certificate, signerDN can be set to point to the trusted root object that contains the certificate of the signing CA, or it can be set to the user object.

flags
(IN) Specifies options when storing user certificates. If the key pair was generated by the Novell Certificate Server and the private key is stored in eDirectory, the flag PKI_INTERNAL_KEY_PAIR should be used. If the key pair was generated external to the Novell Certificate Server, the flag PKI_EXTERNAL_KEY_PAIR should be used.
cert
(IN) Specifies the DER-encoded X.509 certificate that you want to store. This parameter can be a NULL if you called NPKICreateUserCertificate immediately before this function and the error PKI_E_ADD_CERTIFICATE was returned. The flag PKI_INTERNAL_KEY_PAIR must be set when cert is NULL.
certSize
(IN) Specifies the size of the certificate.

This parameter can be 0 if you called NPKICreateUserCertificate immediately before this function and the error PKI_E_ADD_CERTIFICATE was returned. The flag PKI_INTERNAL_KEY_PAIR must be set when certSize is 0.

vendorID
(IN) Specifies which vendor supplied the certificate. If the flag PKI_INTERNAL_KEY_PAIR is set, this parameter is ignored, and the vendorID is set to PKI_VENDOR_NOVELL.
privateKey
(IN) Not implemented in this release. Set to NULL.
privateKeySize
(IN) Not implemented in this release. Set to 0.
reserved1
Reserved for future use.
reserved2
Reserved for future use.

Return Values

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

See Also

NPKICreateUserCertificate, NPKIFindUserCertificates