<apidoc:module name="SSL" category="Extension" lib="ssl" xmlns:apidoc="http://marklogic.com/xdmp/apidoc"><apidoc:summary category="SSL" lib="ssl" access="public">
   <p xmlns="http://www.w3.org/1999/xhtml">The SSL built-in functions are miscellaneous extensions to the
   XQuery core library that expose SSL functionality.</p>
 </apidoc:summary><apidoc:function name="x509-certificate-extract" type="builtin" lib="xdmp" category="AppServerBuiltins" hidden="false" bucket="MarkLogic Built-In Functions">
    <apidoc:summary>
  Returns the XML representation of the specified X.509 certificate.
</apidoc:summary>
    <apidoc:params>
      <apidoc:param name="cert" type="xs:string" optional="false">
    The PEM encoded certificate.
  </apidoc:param>
    </apidoc:params>
    <apidoc:return>An XML representation of the certificate.</apidoc:return>
    <apidoc:example><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
xquery version "1.0-ml"; 
  
let $cert := "-----BEGIN CERTIFICATE-----
MIID4DCCA0mgAwIBAgIJAIp4RM8+Lkr3MA0GCSqGSIb3DQEBBQUAMIGnMQswCQYD
VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTETMBEGA1UEBxMKU2FuIENhcmxv
czETMBEGA1UEChMKTWFyayBMb2dpYzEUMBIGA1UECxMLRW5naW5lZXJpbmcxHjAc
BgNVBAMTFUNlcnRpZmljYXRlIEF1dGhvcml0eTEjMCEGCSqGSIb3DQEJARYUd2Zl
aWNrQG1hcmtsb2dpYy5jb20wHhcNMDgxMjAzMDEyNzQ5WhcNMDkxMjAzMDEyNzQ5
WjCBpzELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExEzARBgNVBAcT
ClNhbiBDYXJsb3MxEzARBgNVBAoTCk1hcmsgTG9naWMxFDASBgNVBAsTC0VuZ2lu
ZWVyaW5nMR4wHAYDVQQDExVDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxIzAhBgkqhkiG
9w0BCQEWFHdmZWlja0BtYXJrbG9naWMuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GN
ADCBiQKBgQDnauIbA33nIH8IpiUyWA9sB/X3d8DU8cKbEes1dk6xX3mFfMWja56D
vkPFaX9/voSbeG1E92d2Y518xvjgoR8okf2rkDI35nqA9ejcuC0wg0tXuh5OSVfr
UpzVSwbCy55fweaVzkKC2TZXgOy5JeNbw+i/UohTLW2TPwQ4rpynPwIDAQABo4IB
EDCCAQwwHQYDVR0OBBYEFLY2z4PX7fWY47gRhGpVJBIJpufYMIHcBgNVHSMEgdQw
gdGAFLY2z4PX7fWY47gRhGpVJBIJpufYoYGtpIGqMIGnMQswCQYDVQQGEwJVUzET
MBEGA1UECBMKQ2FsaWZvcm5pYTETMBEGA1UEBxMKU2FuIENhcmxvczETMBEGA1UE
ChMKTWFyayBMb2dpYzEUMBIGA1UECxMLRW5naW5lZXJpbmcxHjAcBgNVBAMTFUNl
cnRpZmljYXRlIEF1dGhvcml0eTEjMCEGCSqGSIb3DQEJARYUd2ZlaWNrQG1hcmts
b2dpYy5jb22CCQCKeETPPi5K9zAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA
A4GBAA8/lJQK6NmHFvP85LS3Sdfnd9D9opDeehqv4LfoFWxHMiKsxSA7hrYRs6u9
qQxCED54UfB1+kjs2GrM4H1uWeeHADdUKDRVHcivCVqWP4GUD2r0upKj8C3UD46V
aNHLW0yW7Anf4DMBsfhvKfIopBDoP6NPbDith5RtmM98N8xn
-----END CERTIFICATE-----"
 
return xdmp:x509-certificate-extract($cert)

=&gt;

&lt;cert&gt;
  &lt;version&gt;2&lt;/version&gt;
  &lt;serialNumber&gt;8A7844CF3E2E4AF7&lt;/serialNumber&gt;
  &lt;signatureType&gt;sha1WithRSAEncryption&lt;/signatureType&gt;
  &lt;issuer&gt;
    &lt;countryName&gt;US&lt;/countryName&gt;
    &lt;stateOrProvinceName&gt;California&lt;/stateOrProvinceName&gt;
    &lt;localityName&gt;San Carlos&lt;/localityName&gt;
    &lt;organizationName&gt;MarkLogic&lt;/organizationName&gt;
    &lt;organizationalUnitName&gt;Engineering&lt;/organizationalUnitName&gt;
    &lt;commonName&gt;Certificate Authority&lt;/commonName&gt;
    &lt;emailAddress&gt;me@marklogic.com&lt;/emailAddress&gt;
  &lt;/issuer&gt;
  &lt;validity&gt;
    &lt;notBefore&gt;2008-12-03T01:27:49Z&lt;/notBefore&gt;
    &lt;notAfter&gt;2009-12-03T01:27:49Z&lt;/notAfter&gt;
  &lt;/validity&gt;
  &lt;subject&gt;
    &lt;countryName&gt;US&lt;/countryName&gt;
    &lt;stateOrProvinceName&gt;California&lt;/stateOrProvinceName&gt;
    &lt;localityName&gt;San Carlos&lt;/localityName&gt;
    &lt;organizationName&gt;MarkLogic&lt;/organizationName&gt;
    &lt;organizationalUnitName&gt;Engineering&lt;/organizationalUnitName&gt;
    &lt;commonName&gt;Certificate Authority&lt;/commonName&gt;
    &lt;emailAddress&gt;me@marklogic.com&lt;/emailAddress&gt;
  &lt;/subject&gt;
  &lt;publicKey&gt;-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDnauIbA33nIH8IpiUyWA9sB/X3
d8DU8cKbEes1dk6xX3mFfMWja56DvkPFaX9/voSbeG1E92d2Y518xvjgoR8okf2r
kDI35nqA9ejcuC0wg0tXuh5OSVfrUpzVSwbCy55fweaVzkKC2TZXgOy5JeNbw+i/
UohTLW2TPwQ4rpynPwIDAQAB
-----END PUBLIC KEY-----
&lt;/publicKey&gt;
  &lt;v3ext&gt;
    &lt;subjectKeyIdentifier critical="false"&gt;B6:36:CF:83:D7:ED:F5:98:E3:B8:11:84:6A:55:24:12:09:A6:E7:D8&lt;/subjectKeyIdentifier&gt;
    &lt;authorityKeyIdentifier critical="false"&gt;keyid:B6:36:CF:83:D7:ED:F5:98:E3:B8:11:84:6A:55:24:12:09:A6:E7:D8
DirName:/C=US/ST=California/L=San Carlos/O=MarkLogic/OU=Engineering/CN=Certificate Authority/emailAddress=me@marklogic.com
serial:8A:78:44:CF:3E:2E:4A:F7
&lt;/authorityKeyIdentifier&gt;
    &lt;basicConstraints critical="false"&gt;CA:TRUE&lt;/basicConstraints&gt;
  &lt;/v3ext&gt;
&lt;/cert&gt;

  </pre></apidoc:example>
    <algorithm xmlns="http://www.w3.org/1999/xhtml"></algorithm>
  </apidoc:function></apidoc:module>