PemToString (Stringlist function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
Line 12: Line 12:
<td>A <var>Stringlist</var> object that contains base64 encoded data.</td></tr>
<td>A <var>Stringlist</var> object that contains base64 encoded data.</td></tr>
<tr><th>label</th>
<tr><th>label</th>
<td>The string that precedes and succeeds the base64 encoded data, in conformance to the format for X509 certificates and CRLs.</td></tr>
<td>The string that identifies the base64 encoded data you want to convert. X509 certificates and CRLs are bounded by the text markers <code>-----BEGIN <i>label</i>-----</code> and <code>-----End <i>label</i>-----</code>.
<p>
Note that this is a required, case-sensitive, argument; if it does not match the first and last items of <var class="term">sl</var>, no data is returned to <var class="term">%string</var>. </p></td></tr>
<tr><th><var>Occurrence</var></th>
<tr><th><var>Occurrence</var></th>
<td>The occurrence number of the requested tag.</td></tr>
<td>The occurrence number of the requested tag.</td></tr>

Revision as of 17:06, 13 April 2012

Extract base64 encoded PEM data to string (Stringlist class)

[Introduced in Sirius Mods 8.0]


The PEM (Privacy Enhanced Mail) protocol uses base64 encoding for binary data that needs to be transferred and stored as text.

Syntax

%string = sl:PemToString( label, [Occurrence= number]) Throws InvalidPemData

Syntax terms

%string A Longstring or String to contain the decoded binary data in the method object, sl.
sl A Stringlist object that contains base64 encoded data.
label The string that identifies the base64 encoded data you want to convert. X509 certificates and CRLs are bounded by the text markers -----BEGIN label----- and -----End label-----.

Note that this is a required, case-sensitive, argument; if it does not match the first and last items of sl, no data is returned to %string.

Occurrence The occurrence number of the requested tag.

Usage notes

Examples

The following request loads Longstring %ls with the contents of the base64 encoded CRL (Certificate Revocation List) contained in Stringlist %sl:

b %ls is longstring %sl is object stringlist text to %sl = new raw -----BEGIN X509 CRL----- MIIBODCB4zANBgkqhkiG9w0BAQQFADBgMQswCQYDVQQGEwJBVTEMMAoGA1UECBMD UUxEMRkwFwYDVQQKExBNaW5jb20gUHR5LiBMdGQuMQswCQYDVQQLEwJDUzEbMBkG A1UEAxMSU1NMZWF5IGRlbW8gc2VydmVyFw0wMTAxMTUxNjI2NTdaFw0wMTAyMTQx NjI2NTdaMFIwEgIBARcNOTUxMDA5MjMzMjA1WjASAgEDFw05NTEyMDEwMTAwMDBa MBMCAhI0Fw0wMTAxMTUxNjE5NDdaMBMCAhI1Fw0wMTAxMTUxNjIzNDZaMA0GCSqG SIb3DQEBBAUAA0EAHPjQ3M93QOj8Ufi+jZM7Y78TfAzG4jJn/E6MYBPFVQFYo/Gp UZexfjSVo5CIyySOtYscz8oO7avwBxTiMpDEQg== -----END X509 CRL----- end text %ls = %sl:pemToString('X509 CRL') end

See also