
pki:insert-host-certificate( $template-id as xs:unsignedLong, $certs as xs:string, $pkey as xs:string ) as empty-sequence()
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.
(: 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>)
)