CheckCertificateRequest (Stringlist function)

From m204wiki
Revision as of 23:12, 9 May 2012 by JAL2 (talk | contribs)
Jump to navigation Jump to search

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----- 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