Loading TOC...

pki:insert-host-certificate

pki:insert-host-certificate(
   $template-id as xs:unsignedLong,
   $certs as xs:string,
   $pkey as xs:string
) as empty-sequence()

Summary

This function inserts externally generated certificate into the database. This certificate can be used for certificate template specified by template-id. The common name of the certificate can be started with a wildcard "*" so that the certificate can be used for multiple hosts.

Parameters
template-id The certificate template id for the certificate.
certs Externally generated certificate to be inserted into the database.
pkey The none-passphrase protected private key to be inserted into the database. MarkLogic does not support passphrase protected private keys.

Example

  (: execute this against the security database :)
  xquery version "1.0-ml";
  import module namespace pki = "http://marklogic.com/xdmp/pki" at "/MarkLogic/pki.xqy";

  pki:insert-host-certificate(
    17534423939834379460,
    xdmp:document-get(
        "/server.crt",
        <options xmlns="xdmp:document-get"><format>text</format></options>),
    xdmp:document-get(
        "/server.key",
        <options xmlns="xdmp:document-get"><format>text</format></options>)
        )
  

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