
pki:generate-template-certificate-authority( $template-id as xs:unsignedLong, $valid-for as xs:unsignedInt ) as empty-sequence()
This function creates a common temporary certificate authority to sign all the certificates for the specified certificate template.
| Parameters | |
|---|---|
| template-id | The certificate template for which to create the certificate authority. |
| valid-for | The number of days the generated certificate will be valid. |
(: execute this against the security database :)
xquery version "1.0-ml";
import module namespace pki = "http://marklogic.com/xdmp/pki"
at "/MarkLogic/pki.xqy";
let $tid := pki:template-get-id(pki:get-template-by-name("mycert"))
return
pki:generate-template-certificate-authority($tid, 250)
(: Generate a certificate authority for the "mycert" template. :)
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.