CheckCertificateRequest (Stringlist function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
Line 38: Line 38:
text to %creq = new raw
text to %creq = new raw
-----BEGIN NEW CERTIFICATE REQUEST-----
-----BEGIN NEW CERTIFICATE REQUEST-----
MIIBSDCB8wIBADCBjzEMMAoGA1UEBhMDVVNBMQswCQYDVQQIEwJNQTESMBAGA1UE
MIIBzjCCATcCAQAwgY8xDDAKBgNVBAYTA1VTQTELMAkGA1UECBMCTUExEjAQBgNV
BxMJQ2FtYnJpZGdlMR0wGwYDVQQKExRTaXJpdXMgU29mdHdhcmUgSW5jLjEdMBsG
BAcTCUNhbWJyaWRnZTEdMBsGA1UEChMUU2lyaXVzIFNvZnR3YXJlIEluYy4xHTAb
A1UECxMUU29mdHdhcmUgRGV2ZWxvcG1lbnQxIDAeBgNVBAMTF3d3dy5zaXJpdXMt
BgNVBAsTFFNvZnR3YXJlIERldmVsb3BtZW50MSAwHgYDVQQDExd3d3cuc2lyaXVz
c29mdHdhcmUuY29tMFowDQYJKoZIhvcNAQEBBQADSQAwRgJBAMIofDUItsJLIREb
LXNvZnR3YXJlLmNvbTCBnTANBgkqhkiG9w0BAQEFAAOBiwAwgYcCgYEAtR70c/uS
8UJ93Xm3sJRkYI9qus6lPj76iGOLoQEExSVMved24YxtBlC84IPQrl1+foNcFYSv
XL/o2pTi9YZnZv8BRLZP95ErHYWR1juQZJc3nCEEduNMAZFIAbrGLm4k2QRZn2+l
OAnfA0ECAQOgADANBgkqhkiG9w0BAQQFAANBAFY6cU6+8p2E9xejVNACmQx2quSV
qKomoJp/FAYhvH3a0OfmnNfp4csuEXrqr93Vi8Q1UyxlqLMNFRGWjtG2ZpU2rd23
rudOnjS3jGeKl4Ga/wqg3Yrvg5BwMAWxGn1reh7DhX9j/ScjuBWVIgBkU9M=     
pqfBmSHddlijsK/4zJSGohiGBNiP/EUeCC8CAQOgADANBgkqhkiG9w0BAQQFAAOB
gQCmbEAleV+6G7jAn9xoW5Aprp2TCM/lRiVy7Rc9XRdCy0fauxSdRJcACU1IPVxJ
koU03s4tJiXkg5PkYQKvQwFkJsmTgqHlf5G87NmWZwBeM2VflmqD8UuYHil89o+w
QnWOpiuPMHuIF+A0/zF8S+4nUPoqGn466L4aC2tXweWhjw==     
-----END NEW CERTIFICATE REQUEST-----
-----END NEW CERTIFICATE REQUEST-----
end text
end text
Line 50: Line 53:
text to %pk = new raw  
text to %pk = new raw  
-----BEGIN RSA PRIVATE KEY-----  
-----BEGIN RSA PRIVATE KEY-----  
ldXczTt44bm4aDJgqtXKaQGAkqlzqC/sYGNFmUd22PIDEk5V7pZmyHP5y1NqjnGa
MIICWgIBAAKBgQC1HvRz+5Jcv+jalOL1hmdm/wFEtk/3kSsdhZHWO5BklzecIQR2
jiptH/4QaKthEcX5I1t1+Xn1sPzdbw8c8Bpj1bgZ8v6hS5Y+W9KAytB7gnkNkyWV
40wBkUgBusYubiTZBFmfb6Woqiagmn8UBiG8fdrQ5+ac1+nhyy4Reuqv3dWLxDVT
7FxH9BeklNlONvOp1v9RkpuuU13WGTE0SkG0nFsVFucqwyxt/LseaKu8xJhqc/Pq
LGWosw0VEZaO0bZmlTat3bemp8GZId12WKOwr/jMlIaiGIYE2I/8RR4ILwIBAwKB
MzFdHLd4c07sB54qYWg4roZm9bpzQUaJWAiFuqDjgQ9QJzr0+Psy6XTybdWAgdn+
gB4v02ip7bof/CRuJdOWZpEqgDYeYqlC3ITrmE5fQrtuiUSwK2kl4gBC4VWfIQe9
bClVBD8OeIjCKNpGEvGRBLc8gA8kS99S75Yb9/XFXKHhylikDKYo3Rjhfbc1+zB7
BiQrZEU9RkbHBnAZv9irsEnMX1ZgYdntsW5xHe7K1wowBRUrQgAD5SPYRc5b0JEX
23znhn6QRaM/tap+Y9JuAhuzexlsnJnYHuyNNlUYNz9FbqVRfz81QtvhMaVu/HZb
PTPL+aJzNaSQNQ/KW3O+QZVN5p3Co2TqjwDzcutQsSkfAkEA+pYxMH2wTCcmabe3
glwH7LCSI3J34fvIrqJtrQAUswaub7dUCQGX                           
p76qjE2SERSf7nk2yTqw29w1hSYqsj7By51vLWFH/35rMBiqAC5yTgmQjlJIIXw6
kz4ASwJBALkImXUd0PmaJLrCwRIhyDFpeq+UsyaNmtgvjg7W8sEhBRseHV7YXBkh
8mQ6VLMBhtxip7aotArZtwJiPc25ES0CQQCnDst1qSAyxMRGenpv1HGy3mFguGqe
+3nbfHXn6COuGXHMKdaHvkoeQNqqVEd1ZcaqyaGJW7W0NtrA/XxiKVWHAkB7WxD4
votREW3R1ytha9rLm6cfuHdvCRHldQlfOfcra1i8vr4/OugQwUxC0Y3Mq689lxp5
xc1ckSSsQX6JJgtzAkAPAzNsxdsNaAES3L5yqkbux8W2Y2YdjjxZMl1sdPqn9rXN
A8fe68sT76U9rhuJemue1h9jxgq6fscFqZkbNRll                           
-----END RSA PRIVATE KEY-----  
-----END RSA PRIVATE KEY-----  
end text  
end text  
Line 65: Line 74:


The result is shown below:
The result is shown below:
<p class="code">%rc is 1 </p>
<p class="code">%rc is 0 </p>


==See also==
==See also==

Revision as of 23:57, 9 May 2012

Check format of base64 encoded certificate request (Stringlist class)

[Requires Janus Network Security]


This method checks an SSL certificate request against a private key.

Syntax

%rc = sl:CheckCertificateRequest( [PrivateKey=] stringlist, - [[Password=] string])

Syntax terms

%rcAn, optional, numeric variable that is set to zero if the function is a success. The possible return codes are described below in "Return codes".
sl A Stringlist object that contains the certificate request to be checked.
PrivateKey This name allowed parameter is a Stringlist object that contains an RSA-generated private key.
Password This optional, name allowed, parameter is a string that contains a password to decrypt the private key, if necessary.

Return codes

1Keys don't match.
0Keys match.
-1Private key encrypted but no password provided.
-2Private key password invalid.
-4Certificate invalid.
-5Certificate Stringlist identifier missing (request cancellation).
-6Certificate Stringlist identifier invalid (request cancellation).
-7Insufficient storage (request cancellation).
-9Private key invalid.
-10Key Stringlist identifier missing (request cancellation).
-11Key Stringlist identifier invalid (request cancellation).

Usage notes

Examples

In the following example, the CheckCertificateRequest method checks a Janus Security-generated certificate request against a Janus Security-generated private key.

... text to %creq = new raw -----BEGIN NEW CERTIFICATE REQUEST----- MIIBzjCCATcCAQAwgY8xDDAKBgNVBAYTA1VTQTELMAkGA1UECBMCTUExEjAQBgNV BAcTCUNhbWJyaWRnZTEdMBsGA1UEChMUU2lyaXVzIFNvZnR3YXJlIEluYy4xHTAb BgNVBAsTFFNvZnR3YXJlIERldmVsb3BtZW50MSAwHgYDVQQDExd3d3cuc2lyaXVz LXNvZnR3YXJlLmNvbTCBnTANBgkqhkiG9w0BAQEFAAOBiwAwgYcCgYEAtR70c/uS XL/o2pTi9YZnZv8BRLZP95ErHYWR1juQZJc3nCEEduNMAZFIAbrGLm4k2QRZn2+l qKomoJp/FAYhvH3a0OfmnNfp4csuEXrqr93Vi8Q1UyxlqLMNFRGWjtG2ZpU2rd23 pqfBmSHddlijsK/4zJSGohiGBNiP/EUeCC8CAQOgADANBgkqhkiG9w0BAQQFAAOB gQCmbEAleV+6G7jAn9xoW5Aprp2TCM/lRiVy7Rc9XRdCy0fauxSdRJcACU1IPVxJ koU03s4tJiXkg5PkYQKvQwFkJsmTgqHlf5G87NmWZwBeM2VflmqD8UuYHil89o+w QnWOpiuPMHuIF+A0/zF8S+4nUPoqGn466L4aC2tXweWhjw== -----END NEW CERTIFICATE REQUEST----- end text text to %pk = new raw -----BEGIN RSA PRIVATE KEY----- MIICWgIBAAKBgQC1HvRz+5Jcv+jalOL1hmdm/wFEtk/3kSsdhZHWO5BklzecIQR2 40wBkUgBusYubiTZBFmfb6Woqiagmn8UBiG8fdrQ5+ac1+nhyy4Reuqv3dWLxDVT LGWosw0VEZaO0bZmlTat3bemp8GZId12WKOwr/jMlIaiGIYE2I/8RR4ILwIBAwKB gB4v02ip7bof/CRuJdOWZpEqgDYeYqlC3ITrmE5fQrtuiUSwK2kl4gBC4VWfIQe9 BiQrZEU9RkbHBnAZv9irsEnMX1ZgYdntsW5xHe7K1wowBRUrQgAD5SPYRc5b0JEX PTPL+aJzNaSQNQ/KW3O+QZVN5p3Co2TqjwDzcutQsSkfAkEA+pYxMH2wTCcmabe3 p76qjE2SERSf7nk2yTqw29w1hSYqsj7By51vLWFH/35rMBiqAC5yTgmQjlJIIXw6 kz4ASwJBALkImXUd0PmaJLrCwRIhyDFpeq+UsyaNmtgvjg7W8sEhBRseHV7YXBkh 8mQ6VLMBhtxip7aotArZtwJiPc25ES0CQQCnDst1qSAyxMRGenpv1HGy3mFguGqe +3nbfHXn6COuGXHMKdaHvkoeQNqqVEd1ZcaqyaGJW7W0NtrA/XxiKVWHAkB7WxD4 votREW3R1ytha9rLm6cfuHdvCRHldQlfOfcra1i8vr4/OugQwUxC0Y3Mq689lxp5 xc1ckSSsQX6JJgtzAkAPAzNsxdsNaAES3L5yqkbux8W2Y2YdjjxZMl1sdPqn9rXN A8fe68sT76U9rhuJemue1h9jxgq6fscFqZkbNRll -----END RSA PRIVATE KEY----- end text %rc = %creq:checkCertificaterequest(%pk) printText {~} is {%rc} ...

The result is shown below:

%rc is 0

See also