pki:template-set-key-options

pki:template-set-key-options(
   $template as element(pki:template),
   $key-options as element(pki:key-options)
) as element(pki:template)

Summary

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.

Parameters
template The certificate template for which to set the key options.
key-options The options for generating new keys. The valid options are key-length, which specifies the number of bits in a key (512, 1024, 2048, 4096), and pass-phrase, which specifies the pass phrase for encrypting/decrypting a private key.

Example

     (: 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. :)
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy