
pki:template-set-key-options( $template as element(pki:template), $key-options as element(pki:key-options) ) as element(pki:template)
This function sets the options for generating new keys in the
specified certificate template. The returned element must be separately
inserted into the database with pki:insert-template.
(: execute this against the security database :)
xquery version "1.0-ml";
import module namespace pki = "http://marklogic.com/xdmp/pki"
at "/MarkLogic/pki.xqy";
declare namespace ssl = "http://marklogic.com/xdmp/ssl";
let $options := <pki:key-options xmlns="ssl:options">
<key-length>2048</key-length>
</pki:key-options>
return
pki:template-set-key-options(
pki:get-template-by-name("test"), $options)
(: Sets the key options in the "test" template. :)