Loading TOC...

pki:get-pending-certificate-request

pki:get-pending-certificate-request(
   $template-id as xs:unsignedLong,
   $common-name as xs:string,
   $dns-name as xs:string?,
   $ip-addr as xs:string?
) as element(pki:request)?

Summary

This function returns any pending certificate requests for the specified template id and host combination. The certificate request data is return in both PEM-encoded and XML formats. The common name must be specified. The DNS name and IP address are optional.

Parameters
$template-id The certificate template id for the certificate request to be returned.
$common-name The common hostname (e.g., myhost.company.com or company.com) in the certificate request.
$dns-name The DNS name in the certificate request.
$ip-addr The IP address name in the certificate request.

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 $hostname := admin:host-get-name(
                       $config, 
                       admin:host-get-id($config, xdmp:host-name()))

  for $tid in pki:get-template-ids()   
  return
      pki:get-pending-certificate-request($tid, $hostname, (), ())

  (: Returns all of the pending certificate requests for the local host :)
  

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