pki:generate-temporary-certificate( $template-id as xs:unsignedLong, $valid-for as xs:unsignedInt, $common-name as xs:string, $dns-name as xs:string?, $ip-addr as xs:string? ) as empty-sequence()
This function generates a new key pair and temporary certificate from the specified certificate template. If $dns-name or $ip-addr are specified, those portions of the template are replaced with the specified values. The certificate is inserted into the database. This is used to ensure that secure app servers are initially usable while waiting for signed certificates.
(: 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("test")) return pki:generate-temporary-certificate($tid, 150, "My.Host.com", (), ()) (: Generates a temporary certificate from the "test" template. :)
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.