AppendPemData (Stringlist subroutine): Difference between revisions
m (add example) |
m (→See also: add method to list) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 28: | Line 28: | ||
%ls is longstring | %ls is longstring | ||
%sl is object stringlist | %sl is object stringlist | ||
%ls = 'My PEM | %ls = 'My PEM content' | ||
%sl:Appendpemdata(%ls, 'SSL SESSION PARAMETERS') | %sl:Appendpemdata(%ls, 'SSL SESSION PARAMETERS') | ||
printtext {~} = {%sl:print} | printtext {~} = {%sl:print} | ||
Line 36: | Line 36: | ||
The result is: </p> | The result is: </p> | ||
<p class="output"><nowiki>%sl:print = -----BEGIN SSL SESSION PARAMETERS----- | <p class="output"><nowiki>%sl:print = -----BEGIN SSL SESSION PARAMETERS----- | ||
1KhA18XUQIOWlaOFlaM= | |||
-----END SSL SESSION PARAMETERS----- | -----END SSL SESSION PARAMETERS----- | ||
</nowiki></p> | </nowiki></p> | ||
If you apply the <var>Base64toString</var> method to the string within the begin and end markers in the preceding result, that is: | If you were to apply the <var>Base64toString</var> method to the string within the begin and end markers in the preceding result, that is: | ||
<p class="code">printtext {~} = {' | <p class="code">printtext {~} = {'1KhA18XUQIOWlaOFlaM=':base64tostring} | ||
</p> | </p> | ||
The result is: | The result is: | ||
<p class="output">' | <p class="output">'1KhA18XUQIOWlaOFlaM=':base64tostring = My PEM content </p> | ||
==See also== | ==See also== | ||
Line 55: | Line 55: | ||
<li><var>[[SignedCertificate (String function)|SignedCertificate]]</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>[[DerToXmlDoc (String function)|DerToXmlDoc]]</var> </li> | ||
Line 69: | Line 71: | ||
<var>System</var> methods: </p> | <var>System</var> methods: </p> | ||
<ul> | <ul> | ||
<li><var>[[ClientCertificate (System function)|ClientCertificate]]</var> | <li><var>[[ClientCertificate (System function)|ClientCertificate]]</var> </li><li><var>[[GeneratedPrivateKey (System function)|GeneratedPrivateKey]]</var> </li> | ||
</ul> | </ul> | ||
<p> | <p> |
Latest revision as of 15:13, 6 September 2018
Append PEM encoded string to a Stringlist (Stringlist class)
[Introduced in Model 204 7.5]
The PEM (Privacy Enhanced Mail) protocol uses base64 encoding for binary data that needs to be transferred and stored as text. AppendPemData lets you store PEM data as a series of base64 encoded Stringlist items within beginning and ending text marker items.
Syntax
sl:AppendPemData( [Data=] string, [label=] string)
Syntax terms
sl | A Stringlist object that contains labeled, base64 encoded data. |
---|---|
Data | The Longstring or String you are appending to the data stored in sl. |
label | The string that identifies the base64 encoded data you are appending. The data is stored as a series of sl items contained within items that are the text markers -----BEGIN label----- and -----END label----- .
This is a required, case-sensitive, value. |
Usage notes
- The appended data is retrievable with the PemToString method.
Examples
b %ls is longstring %sl is object stringlist %ls = 'My PEM content' %sl:Appendpemdata(%ls, 'SSL SESSION PARAMETERS') printtext {~} = {%sl:print} end
The result is:
%sl:print = -----BEGIN SSL SESSION PARAMETERS----- 1KhA18XUQIOWlaOFlaM= -----END SSL SESSION PARAMETERS-----
If you were to apply the Base64toString method to the string within the begin and end markers in the preceding result, that is:
printtext {~} = {'1KhA18XUQIOWlaOFlaM=':base64tostring}
The result is:
'1KhA18XUQIOWlaOFlaM=':base64tostring = My PEM content
See also
Stringlist methods:
- AppendCertificateInfo
- AppendCertificateRequest
- AppendCertificateRequestInfo
- AppendClientCertificateRequest
- AppendEncryptedSecurityData
- AppendGeneratedPrivateKey
- AppendPemData
- AppendPrivateKeyInfo
- AppendSignedCertificate
- AppendSignedClientCertificate
- CheckCertificate
- CheckCertificateRequest
- PemToString
String methods:
- CertificateRequest
- SignedCertificate
- SignedClientCertificate
- DerToXmlDoc
- RSAPrivateKeyToXmlDoc
- X509CertificateToXmlDoc
- X509CrlToXmlDoc
- Multiple cryptographic cipher methods
System methods:
Socket methods:
Background information: