MarkLogic Server 11.0 Product Documentation
xdmp:x509-certificate-generate

xdmp:x509-certificate-generate(
   $cert as element(x509:cert),
   [$private-key as xs:string?],
   [$options as (element()|map:map)?]
) as xs:string

Summary

Generate a new PEM-encoded X.509 certificate.

Parameters
$cert The XML representation of the X.509 certificate.
$private-key The PEM encoded private key. This need not be provided and will be ignored when the credential-id option is used.
options Options with which to customize this function. You can specify options as either an options XML element in the namespace "ssl:options" or a map:map. The options names shown below are XML localnames. When using a map, replace the hyphens in an option name with camel casing. For example, "an-option" becomes "anOption" when used a map key. This function supports the following options:
ca-cert
The CA certificate.
pass-phrase
The pass phrase for encrypting/decrypting a private key.
credential-id
The credential to be used to sign the generated certificate.

Example

xdmp:x509-certificate-generate(
<cert xmlns="http://marklogic.com/xdmp/x509">
  <issuer>
    <stateOrProvinceName>CA</stateOrProvinceName>
    <organizationName>MarkLogic</organizationName>
    <localityName>San Carlos</localityName>
    <commonName>JGD Certificate Authority</commonName>
    <countryName>US</countryName>
    <organizationalUnitName>Eng</organizationalUnitName>
    <emailAddress>jdonner@marklogic.com</emailAddress>
  </issuer>
  <publicKey>
-----BEGIN RSA PUBLIC KEY-----
MIIBCgKCAQEAq79ScXTQ54qrYD1cxLW/X3vLIusYq4PSDkKrWIcrwkeEXOEfAPL0
WibCYdYi3EE7EqWAFFBxB2OIqC7VxNi3IQXx9b3qdcNKGSjwpBH0bI347IZQJpFw
e/n80Srwo4vpvlYIuOlHegOmitZsRfdLZq9j5sWf43rY44YWeZ/qSRVIuYOEonGW
0/hIEseeJss61vpkL0aWdytRvX7D88e58JeqA8498E9vVHGzYMWpbgf/F+6pdIwg
GdqsI+1/VCy2exAHoSAw/aWVdc/qSMhA5LklcmqsBNOX/5dODnfyp4r8Qrq21KYo
oZjib4db4iQ7HheuUeURgnGSuLdznCJoVwIDAQAB
-----END RSA PUBLIC KEY-----
  </publicKey>
  <subject>
    <stateOrProvinceName>CA</stateOrProvinceName>
    <organizationName>MarkLogic</organizationName>
    <localityName>San Carlos</localityName>
    <commonName>JGD Certificate Authority</commonName>
    <countryName>US</countryName>
    <organizationalUnitName>Eng</organizationalUnitName>
    <emailAddress>jdonner@marklogic.com</emailAddress>
  </subject>
  <validity>
    <notAfter>2015-12-15T21:24:50Z</notAfter>
    <notBefore>2015-04-09T21:24:50Z</notBefore>
  </validity>
  <v3ext>
    <basicConstraints critical="false">CA:TRUE</basicConstraints>
    <keyUsage critical="false">Certificate Sign, CRL Sign</keyUsage>
    <nsCertType critical="false">SSL Server</nsCertType>
    <subjectKeyIdentifier critical="false">C9:FC:63:0D:F0:CF:AE:78</subjectKeyIdentifier>
  </v3ext>
  <version>2</version>
  <serialNumber>BA0195369CD6B679</serialNumber>
</cert>,
"-----BEGIN PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCrv1JxdNDniqtg
PVzEtb9fe8si6xirg9IOQqtYhyvCR4Rc4R8A8vRaJsJh1iLcQTsSpYAUUHEHY4io
LtXE2LchBfH1vep1w0oZKPCkEfRsjfjshlAmkXB7+fzRKvCji+m+Vgi46Ud6A6aK
1mxF90tmr2PmxZ/jetjjhhZ5n+pJFUi5g4SicZbT+EgSx54myzrW+mQvRpZ3K1G9
fsPzx7nwl6oDzj3wT29UcbNgxaluB/8X7ql0jCAZ2qwj7X9ULLZ7EAehIDD9pZV1
z+pIyEDkuSVyaqwE05f/l04Od/KnivxCurbUpiihmOJvh1viJDseF65R5RGCcZK4
t3OcImhXAgMBAAECggEAJgG91du7CzJVwINzzxhFVHUJvB14pSQTzRIV5w5qsaCv
+vnaqZQaXQTsyUfhCQrqbrLvSA+RI8h0Cnvq1Jf81rMBG5e+lfb0o+K6diR/CbLV
XkpO3GodEWJ9/y/YdujUfkl9vqXpKmg6Z8kRxt318rBnlD8xpd6etqMKwDmSWD+f
mkvK11gJJo+bMClalSYGiP5A5bSW2kbp87rB7mc/q0/zfUSB4orIORxZDj5TXma+
PGeN+owxEn+m6XA1TM7m32ZK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tu843ZyYt5CYSdv9LxgzKDa/
1JL03pJK1Y297Vg+6JYptyXSBrjAzBKQHK1e9VBJvrtGng4qW6XPnebQKAfdnGm0
r7nPTGkp2es5NMSBEx+AHHQxx2XQShrkRBuKu3eUEehwfsTLIHnrf/yVE80TwklB
/5vjiWK9UXl1zz4ifC+4Avm9Mvbn3ayz7hJkysvPFsoM62r99dEZ+QfwsBjNAH53
7i/9HN7c7w13J5J+8cMX6r26
-----END CERTIFICATE-----
Powered by MarkLogic Server | Terms of Use | Privacy Policy