AppendCertificateRequestInfo (Stringlist function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Automatically generated page update)
 
m (→‎See also: add method to list)
 
(34 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Template:Stringlist:AppendCertificateRequestInfo subtitle}}
{{Template:Stringlist:AppendCertificateRequestInfo subtitle}}
This [[Notation conventions for methods#Callable functions|callable]] method adds lines from the information portion of an SSL certificate to the end of a <var>Stringlist</var>.


This page is [[under construction]].
==Syntax==
==Syntax==
{{Template:Stringlist:AppendCertificateRequestInfo syntax}}
{{Template:Stringlist:AppendCertificateRequestInfo syntax}}
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%rc</th><td>number</td></tr>
<tr><th>%rc</th>
<td>An, optional, numeric variable that is set to zero if the function is a success. The possible return codes are described elsewhere in [[AppendCertificateInfo (Stringlist function)#Return codes|Return codes]]. </td></tr>
 
<tr><th>sl</th>
<tr><th>sl</th>
<td>Stringlist object</td></tr>
<td>A <var>Stringlist</var> object.</td></tr>
 
<tr><th>certificateRequest</th>
<tr><th>certificateRequest</th>
<td><var>Stringlist</var> object</td></tr>
<td>A <var>Stringlist</var> object that contains the raw text of an SSL certificate request.</td></tr>
</table>
</table>
==Usage notes==
==Usage notes==
<ul>
<li>The updated <var>Stringlist</var> contains an arbitrary amount of
information in an arbitrary order. Each list item
is in "ID=value" format. These are the possible IDs:
<table class="thJustBold">
<tr><th>S.C</th><td>Subject country</td></tr>
<tr><th>S.S<td>Subject state or province </td></tr>
<tr><th>S.L<td>Subject locality - city, town, village, etc. </td></tr>
<tr><th>S.O<td>Subject organization  </td></tr> 
<tr><th>S.OU<td>Subject organization unit  </td></tr> 
<tr><th>S.CN<td>Subject common name  </td></tr>
<tr><th>I.C<td>Issuer country </td></tr>
<tr><th>I.S<td>Issuer state or province  </td></tr>
<tr><th>I.L<td>Issuer locality - city, town, village, etc. </td></tr>
<tr><th>I.O<td>Issuer organization  </td></tr>
<tr><th>I.OU<td>Issuer organization unit  </td></tr>
<tr><th>I.CN<td>Issuer common name  </td></tr>
<tr><th>EFF<td>Effective date in YYMMDDHHMISS format (GMT)  </td></tr>
<tr><th>EXP<td>Expiration date in YYMMDDHHMISS format (GMT) </td></tr>
<tr><th>ALG<td>Key algorithm - currently always RSA </td></tr> 
<tr><th>N<td>Public modulus in hexadecimal  </td></tr>
<tr><th>E<td>Public exponent in hexadecimal </td></tr>
</table>
</ul>
==Examples==
==Examples==
In the following example, a certificate request is hard-coded into one <var>Stringlist</var>, then the information contained in the certificate is translated via <var>AppendCertificateInfo</var> into another <var>Stringlist</var>:
<p class="code">b
%sl  is object stringlist
%creq is object stringlist
%sl = new
%creq = new
text to %creq raw
&#45;----BEGIN NEW CERTIFICATE REQUEST-----                         
MIIBSTCB9AIBADCBkzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAk1BMRIwEAYDVQQH
EwlDYW1icmlkZ2UxHTAbBgNVBAoTFFNpcml1cyBTb2Z0d2FyZSBJbmMuMR0wGwYD
VQQLExRTb2Z0d2FyZSBEZXZlbG9wbWVudDElMCMGA1UEAxMcd3d3LnNpcml1cy1z
b2Z0d2FyZS5jb206NDQ0NDBZMA0GCSqGSIb3DQEBAQUAA0gAMEUCQGeK7FoF5KOV
fkJeY+/mGFB/mnqOK+lXtKkyGsvE2IT3sWe6bt4/UBxAmryflxa1xnRirTBcvyr2
092HW5Cie90CAQMwDQYJKoZIhvcNAQEEBQADQQAfh/JQALxnQo9YFczgpSbLlN6i
UKSS4qVe1e2resil+rSmrG+W9YTBIDnT2GcdotAIF9L3/6LQdmuipXgicg3m   
&#45;----END NEW CERTIFICATE REQUEST-----                           
end text
%sl:appendCertificateInfo(%creq)
%sl:print
end
</p>
The result is something like:
<p class="output">S.C=US
S.S=MA
S.L=Cambridge
S.O=Sirius Software Inc.
S.OU=Software Development
S.CN=www.sirius-software.com:4444   
ALG=RSA
N=678AEC5A05E4A3957E425E63EFE618507F9A7A8E ... 305CBF2AF6D3DD875B90A27BDD
E=03
</p>
==See also==
==See also==
<p>
<var>Stringlist</var> methods: </p>
{{Template:Stringlist crypto methods}}
<p>
<var>String</var> methods:</p>
<ul>
<li><var>[[CertificateRequest (String function)|CertificateRequest]]</var> </li>
<li><var>[[SignedCertificate (String function)|SignedCertificate]]</var> </li>
<li><var>[[SignedClientCertificate (String function)|SignedClientCertificate]]</var> </li>
<li><var>[[DerToXmlDoc (String function)|DerToXmlDoc]]</var> </li>
<li><var>[[RSAPrivateKeyToXmlDoc (String function)|RSAPrivateKeyToXmlDoc]]</var></li>
<li><var>[[X509CertificateToXmlDoc (String function)|X509CertificateToXmlDoc]]</var> </li>
<li><var>[[X509CrlToXmlDoc (String function)|X509CrlToXmlDoc]]</var> </li>
<li>Multiple cryptographic cipher methods </li>
</ul>
<p>
<var>System</var> methods: </p>
<ul>
<li><var>[[ClientCertificate (System function)|ClientCertificate]]</var> </li><li><var>[[GeneratedPrivateKey (System function)|GeneratedPrivateKey]]</var> </li>
</ul>
<p>
<var>Socket</var> methods: </p>
<ul>
<li><var>[[Certificate (Socket function)|Certificate]]</var> </li>
</ul>
{{Template:Stringlist:AppendCertificateRequestInfo footer}}
{{Template:Stringlist:AppendCertificateRequestInfo footer}}

Latest revision as of 15:11, 6 September 2018

Add certificate request information to a Stringlist (Stringlist class)

[Requires Janus Network Security]

This callable method adds lines from the information portion of an SSL certificate to the end of a Stringlist.

Syntax

[%rc =] sl:AppendCertificateRequestInfo( certificateRequest)

Syntax terms

%rc An, optional, numeric variable that is set to zero if the function is a success. The possible return codes are described elsewhere in Return codes.
sl A Stringlist object.
certificateRequest A Stringlist object that contains the raw text of an SSL certificate request.

Usage notes

  • The updated Stringlist contains an arbitrary amount of information in an arbitrary order. Each list item is in "ID=value" format. These are the possible IDs:
    S.CSubject country
    S.SSubject state or province
    S.LSubject locality - city, town, village, etc.
    S.OSubject organization
    S.OUSubject organization unit
    S.CNSubject common name
    I.CIssuer country
    I.SIssuer state or province
    I.LIssuer locality - city, town, village, etc.
    I.OIssuer organization
    I.OUIssuer organization unit
    I.CNIssuer common name
    EFFEffective date in YYMMDDHHMISS format (GMT)
    EXPExpiration date in YYMMDDHHMISS format (GMT)
    ALGKey algorithm - currently always RSA
    NPublic modulus in hexadecimal
    EPublic exponent in hexadecimal

Examples

In the following example, a certificate request is hard-coded into one Stringlist, then the information contained in the certificate is translated via AppendCertificateInfo into another Stringlist:

b %sl is object stringlist %creq is object stringlist %sl = new %creq = new text to %creq raw -----BEGIN NEW CERTIFICATE REQUEST----- MIIBSTCB9AIBADCBkzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAk1BMRIwEAYDVQQH EwlDYW1icmlkZ2UxHTAbBgNVBAoTFFNpcml1cyBTb2Z0d2FyZSBJbmMuMR0wGwYD VQQLExRTb2Z0d2FyZSBEZXZlbG9wbWVudDElMCMGA1UEAxMcd3d3LnNpcml1cy1z b2Z0d2FyZS5jb206NDQ0NDBZMA0GCSqGSIb3DQEBAQUAA0gAMEUCQGeK7FoF5KOV fkJeY+/mGFB/mnqOK+lXtKkyGsvE2IT3sWe6bt4/UBxAmryflxa1xnRirTBcvyr2 092HW5Cie90CAQMwDQYJKoZIhvcNAQEEBQADQQAfh/JQALxnQo9YFczgpSbLlN6i UKSS4qVe1e2resil+rSmrG+W9YTBIDnT2GcdotAIF9L3/6LQdmuipXgicg3m -----END NEW CERTIFICATE REQUEST----- end text %sl:appendCertificateInfo(%creq) %sl:print end

The result is something like:

S.C=US S.S=MA S.L=Cambridge S.O=Sirius Software Inc. S.OU=Software Development S.CN=www.sirius-software.com:4444 ALG=RSA N=678AEC5A05E4A3957E425E63EFE618507F9A7A8E ... 305CBF2AF6D3DD875B90A27BDD E=03

See also

Stringlist methods:

String methods:

System methods:

Socket methods: