pki:authority-sign-host-certificate-request( $credential-id as xs:unsignedLong, $x509-req as element(x509:req), $not-before as xs:dateTime, $not-after as xs:dateTime ) as xs:string
This function signs a host certificate request.
xquery version "1.0-ml"; import module namespace pki = "http://marklogic.com/xdmp/pki" at "/MarkLogic/pki.xqy"; declare namespace x509 = "http://marklogic.com/xdmp/x509"; let $req := pki:generate-certificate-request( pki:get-template-by-name("test")/pki:template-id, "ACME Eng Server", "www.eng.acme.com", "1.2.3.4") let $cert := pki:authority-sign-host-certificate-request( xdmp:credential-id("acme-ca"), xdmp:x509-request-extract($req), fn:current-dateTime(), fn:current-dateTime() + xs:dayTimeDuration("P365D")) return ( xdmp:x509-request-extract($req), xdmp:x509-certificate-extract($cert), $req, $cert )
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.