Loading TOC...

sec.credentialSetCertificate

sec.credentialSetCertificate(
   $credential-name as String,
   $certificate as String?,
   $private-key as String?
) as null

Summary

This function updates the certificate for the credential. The private key is set at the same time because the two must be matched and cannot independently change.

Parameters
$credential-name The name of the credential.
$certificate The new certificate, if any.
$private-key The private key for $certificate.

Required Privileges

http://marklogic.com/xdmp/privileges/credential-set-certificate

Usage Notes

This function must be executed against the security database.

Example



    declareUpdate();
    const sec = require('/MarkLogic/security.xqy');
      
    sec.credentialSetCertificate("my-secure-credential", "newcert", "newkey");
    // needs real cert and key

      

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.