CheckCertificateRequest (Stringlist function)
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
%rc | An, 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
1 | Keys don't match. |
---|---|
0 | Keys match. |
-1 | Private key encrypted but no password provided. |
-2 | Private key password invalid. |
-4 | Certificate invalid. |
-5 | Certificate Stringlist identifier missing (request cancellation). |
-6 | Certificate Stringlist identifier invalid (request cancellation). |
-7 | Insufficient storage (request cancellation). |
-9 | Private key invalid. |
-10 | Key Stringlist identifier missing (request cancellation). |
-11 | Key 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----- MIIBSDCB8wIBADCBjzEMMAoGA1UEBhMDVVNBMQswCQYDVQQIEwJNQTESMBAGA1UE BxMJQ2FtYnJpZGdlMR0wGwYDVQQKExRTaXJpdXMgU29mdHdhcmUgSW5jLjEdMBsG A1UECxMUU29mdHdhcmUgRGV2ZWxvcG1lbnQxIDAeBgNVBAMTF3d3dy5zaXJpdXMt c29mdHdhcmUuY29tMFowDQYJKoZIhvcNAQEBBQADSQAwRgJBAMIofDUItsJLIREb 8UJ93Xm3sJRkYI9qus6lPj76iGOLoQEExSVMved24YxtBlC84IPQrl1+foNcFYSv OAnfA0ECAQOgADANBgkqhkiG9w0BAQQFAANBAFY6cU6+8p2E9xejVNACmQx2quSV rudOnjS3jGeKl4Ga/wqg3Yrvg5BwMAWxGn1reh7DhX9j/ScjuBWVIgBkU9M= -----END NEW CERTIFICATE REQUEST----- end text text to %pk = new raw -----BEGIN RSA PRIVATE KEY----- ldXczTt44bm4aDJgqtXKaQGAkqlzqC/sYGNFmUd22PIDEk5V7pZmyHP5y1NqjnGa jiptH/4QaKthEcX5I1t1+Xn1sPzdbw8c8Bpj1bgZ8v6hS5Y+W9KAytB7gnkNkyWV 7FxH9BeklNlONvOp1v9RkpuuU13WGTE0SkG0nFsVFucqwyxt/LseaKu8xJhqc/Pq MzFdHLd4c07sB54qYWg4roZm9bpzQUaJWAiFuqDjgQ9QJzr0+Psy6XTybdWAgdn+ bClVBD8OeIjCKNpGEvGRBLc8gA8kS99S75Yb9/XFXKHhylikDKYo3Rjhfbc1+zB7 23znhn6QRaM/tap+Y9JuAhuzexlsnJnYHuyNNlUYNz9FbqVRfz81QtvhMaVu/HZb glwH7LCSI3J34fvIrqJtrQAUswaub7dUCQGX -----END RSA PRIVATE KEY----- end text %rc = %creq:checkCertificaterequest(%pk) printText {~} is {%rc} ...
The result is shown below:
%rc is 1
See also
- AppendCertificateInfo
- AppendCertificateRequestInfo
- AppendSignedCertificate
- AppendSignedClientCertificate