PemToString (Stringlist function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
Line 1: Line 1:
{{Template:Stringlist:PemToString subtitle}}
{{Template:Stringlist:PemToString subtitle}}


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


==Syntax==
==Syntax==
Line 7: Line 7:
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%string</th><td>string</td></tr>
<tr><th>%string</th><td>A <var>Longstring</var> or <var>String<var> to contain the decoded binary data in the method object, >var class="term">sl</var>.</td></tr>
<tr><th>sl</th>
<tr><th>sl</th>
<td>Stringlist object</td></tr>
<td>A <var>Stringlist</var> object that contains Base64 encoded data.</td></tr>
<tr><th>label</th>
<tr><th>label</th>
<td>string</td></tr>
<td>string</td></tr>
Line 17: Line 17:


==Usage notes==
==Usage notes==
==Examples==
==Examples==
The following request loads <var>Longstring</var> <code>%ls</code> with the contents of the base64 encoded CRL (Certificate Revocation List) contained in <var>Stringlist</var> <code>%sl</code>:<p class="code">    b                                                                   
The following request loads <var>Longstring</var> <code>%ls</code> with the contents of the base64 encoded CRL (Certificate Revocation List) contained in <var>Stringlist</var> <code>%sl</code>:<p class="code">    b                                                                   
Line 23: Line 24:
     %sl    is object stringlist                                       
     %sl    is object stringlist                                       
                                                                        
                                                                        
     text to %sl = new raw                                               
     [[Text and Html statements#The To option for %stringlist, Audit, Print, or Trace|text to]] %sl = new raw                                               
       -----BEGIN X509 CRL-----                                         
       -----BEGIN X509 CRL-----                                         
       MIIBODCB4zANBgkqhkiG9w0BAQQFADBgMQswCQYDVQQGEwJBVTEMMAoGA1UECBMD
       MIIBODCB4zANBgkqhkiG9w0BAQQFADBgMQswCQYDVQQGEwJBVTEMMAoGA1UECBMD

Revision as of 23:09, 11 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

%stringA Longstring or String to contain the decoded binary data in the method object, >var class="term">sl.
sl A Stringlist object that contains Base64 encoded data.
label 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