MarkLogic 10 Product Documentation
pki:delete-certificate

pki:delete-certificate(
   $certificate-id as xs:unsignedLong
) as empty-sequence()

Summary

This function removes the specified certificate from the Security database.

Parameters
certificate-id The id of the certificate to be removed.

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 x509=  "http://marklogic.com/xdmp/x509";
 
  let $cert-id := pki:get-certificates(pki:get-trusted-certificate-ids())
      [x509:cert/x509:subject/x509:organizationName eq "Bad Company"]
      /pki:certificate-id
      
  return  pki:delete-certificate($cert-id)

  (: Removes the certificates issued by "Bad Company" from the database. :)
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy