MarkLogic Server 11.0 Product Documentation
pki:insert-trusted-certificates

pki:insert-trusted-certificates(
   $certs as xs:string
) as xs:unsignedLong*

Summary

This function inserts PEM-encoded certificates into the database without checking for a matching certificate request. This allows you to insert temporary certificates and those from new Certificate Authorities.

Parameters
certs One or more PEM-encoded certificates to be inserted into the database.

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";

  pki:insert-trusted-certificates(
     xdmp:document-get(
         "c:\TrustedCertificates\Trusted_cert.cer", 
         <options xmlns="xdmp:document-get"><format>text</format></options>))

  (: Inserts the PEM-encoded trusted certificate from the Trusted_cert.cer file into
     the database. :)
  

Example

xquery version "1.0-ml"; 

(: execute this against the security database :)
import module namespace pki = "http://marklogic.com/xdmp/pki" 
at "/MarkLogic/pki.xqy";

(: This is an example of supplying multiple certificates in one string :)
pki:insert-trusted-certificates('
subject=/C=US/O=Acme/OU=Acme Global Common/CN=AGC CA 1
issuer=/C=US/O=AcmeTrust/CN=AcmeTrust Global Common Root CA 1
----BEGIN CERTIFICATE----
    EXAM3pLEO7nlYhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0pl
...
cQU6yDQaVUIyUiHcl/PJUKA5KpKujllZYMgPAUW//w==
----END CERTIFICATE----

----BEGIN CERTIFICATE----
    EXAMP4pLEO8nlYIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCB
...
jjxDah2nGN59PRbxYvnKkKj9
----END CERTIFICATE----
')
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy