Loading TOC...

pki:is-temporary

pki:is-temporary(
   $cert as element(pki:certificate)
) as xs:boolean

Summary

This function returns true if the certificate is temporary. Otherwise, it returns false.

Parameters
$cert The certificate to be tested.

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";
  import module namespace admin = "http://marklogic.com/xdmp/admin" 
      at "/MarkLogic/admin.xqy";

  let $config := admin:get-configuration()
  let $tid := pki:template-get-id(pki:get-template-by-name("mycert"))
  let $hostname := admin:host-get-name(
                       $config, 
                       admin:host-get-id($config, xdmp:host-name()))
     
  return pki:is-temporary(pki:get-certificate($tid, $hostname, (), ())) 

  (: Returns 'true' if certificate is temporary; otherwise 'false'. :)
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.