Loading TOC...

MarkLogic Server 11.0 Product Documentation
xdmp:certificate-validate-key-pair

xdmp:certificate-validate-key-pair(
   $public-key as xs:string,
   $private-key as xs:string
) as xs:boolean

Summary

Checks if a public key and private key match within an asymmetric encryption sequence. Returns true if the public and private keys match and false otherwise.

Parameters
public-key The public key/certificate that is being checked in this asymmetric encryption scheme.
private-key The private key that is being checked in this asymmetric encryption scheme.

Example

xquery version "1.0-ml";

let $public-key := "-----BEGIN CERTIFICATE-----
MIIEtjCCAx4CCQCbPmq6Wop60DANBgkqhkiG9w0BAQsFADCBnDELMAkGA1UEBhMC
VVMxCzAJBgNVBAgMAlRYMQ4wDAYDVQQHDAVQbGFubzESMBAGA1UECgwJTWFya0xv
Z2ljMRQwEgYDVQQLDAtFbmdpbmVlcmluZzEiMCAGA1UEAwwZbWFjcHJvLTM5MTIu
bWFya2xvZ2ljLmNvbTEiMCAGCSqGSIb3DQEJARYTaWFtamVmZngwQGdtYWlsLmNv
bTAeFw0yMjA5MjkyMDE5MDFaFw0yMzA5MjQyMDE5MDFaMIGcMQswCQYDVQQGEwJV
UzELMAkGA1UECAwCVFgxDjAMBgNVBAcMBVBsYW5vMRIwEAYDVQQKDAlNYXJrTG9n
aWMxFDASBgNVBAsMC0VuZ2luZWVyaW5nMSIwIAYDVQQDDBltYWNwcm8tMzkxMi5t
YXJrbG9naWMuY29tMSIwIAYJKoZIhvcNAQkBFhNpYW1qZWZmeDBAZ21haWwuY29t
MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA2YQkOSRx8+GlyyCD21Vm
lrE44zXeuxy8TW/E+VOABNAKXWfVa+NfBLx8CoWnL1WgsNAiRyMV8HVDu4eY6Vlr
gW4TSfeSJTJNl2ETtswYufK6SSYeLjfwNmkPC1Mg/Bjn86dP180/Oq3NibWzOvo8
e2CxNXkbOLZjmT/Opog45i/sICpV7UYEGlNOpuA18Walg7Zcxf1B6XBVUeCIyMev
0TxEY2iPzqIkBZI0JD4e3FSriiK/Y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HW+UFSeWkyp28DLe7zcv8CarAmmIk2Yfa6IW8gA==
-----END RSA PRIVATE KEY-----"

return xdmp:certificate-validate-key-pair($public-key, $private-key)

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