AppendPrivateKeyInfo (Stringlist function): Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 8: | Line 8: | ||
===Syntax terms=== | ===Syntax terms=== | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>%number</th><td> | <tr><th>%number</th><td>An, optional, numeric variable that is set to zero if the function is a success. </td></tr> | ||
<tr><th>sl</th> | <tr><th>sl</th> | ||
<td>A <var>Stringlist</var> object to receive the private key information.</td></tr> | <td>A <var>Stringlist</var> object to receive the private key information.</td></tr> | ||
Line 20: | Line 20: | ||
==Examples== | ==Examples== | ||
In the following example, a private key is hard-coded into one <var>Stringlist</var>, then the information contained in the private key is extracted via <var>AppendCertificateInfo</var> into another <var>Stringlist</var>: | |||
<p class="code">b | |||
%sl is object stringlist | |||
%pkey is object stringlist | |||
%sl = new | |||
%pkey = new | |||
text to %pkey raw | |||
----BEGIN RSA PRIVATE KEY----- | |||
MIIEogIBAAKCAQEAm6TwmSXt4+lyrhwy9SBq2LVjdTeJ5kUbU9jzmBCfw/NuC1tX | |||
YAAdc0UG5DDJYPHkWkYa7+z50SYzmoxKI8PfCLyxSOPeVW9CEhRSyiIIlyjQikIK | |||
a0YMeOXVetGiutl/y346yQYltkbQXb1SOogTg07fTRs7NWcQ4Rrcd6DEnSkrHxbv | |||
T04Z0MwoSojA+NRyBCMpa+w+R0dzrBNZIT11WOccecYjEyuPSS2ydcdgr/Rp4WKC | |||
UHmRulXWQjhEjwqFPRG4f8BkYJGr8lN262M4ti4Z11KV/lYA/lEpYUkmCaY936p4 | |||
IoVoQy8GFn7mj50sxwSa446bTvKlVPsySMDK2wIBAwKCAQAZ8NLEMPz7UZMdBLMo | |||
... | |||
aQmxZUwUo7em8Ci6dX17AoGAcmpQ5AUj5vMdRnOmiIhLM+jgbbQjBD+52hwbkkIn | |||
sZ00cQ5asvdrHt3ziIqN7RMu5okuwdFTdk5IGHTA43qykel0e7wxwADI7qybJXWF | |||
rsIve5XyKCD55gAM4W8y4+CLkCv6dPwmkTq4vfdaYr0/NPIvigzUq0NEXFVPJfQc | |||
GncCgYEAlFIEKq0mVWLBtZRwNjehKOaWGkVVHJnoWqlBngfamQkOiGvWScQ0MVbw | |||
K3U00KpuNHRF5RVy035uoU2tnQDLyG+RmUO7j2+t90MOmgXqiZlTz08uf/fQaprd | |||
NzpmjANA/9cT3rwHD31LsjaDXASM5IW0q7h+vhvVLtVkDzDnW5w= | |||
-----END RSA PRIVATE KEY----- | |||
end text | |||
%sl:appendPrivateKeyInfo(%pkey) | |||
%sl:print | |||
end | |||
</p> | |||
The result is something like: | |||
<p class="output"> | |||
ALG=RSA | |||
N=9BA4F09925EDE3E972AE1C32F5206AD8 ... A461AEFECF9D126339A8C4A23C3DF08B- | |||
CB148E3DE556F42121452CA22089728D08 ... 4D1B3B356710E11ADC77A0C49D292B1F- | |||
16EF4F4E19D0CC284A88C0F8D472042329 ... 2507991BA55D64238448F0A853D11B87- | |||
FC0646091ABF25376EB6338B62E19D7529 ... E38E9B4EF2A554FB3248C0CADB | |||
E=03 | |||
</p> | |||
==See also== | ==See also== | ||
<ul> | |||
<li><var>[[AppendCertificateInfo (Stringlist function)|AppendCertificateInfo]]</var> | |||
</ul> | |||
{{Template:Stringlist:AppendPrivateKeyInfo footer}} | {{Template:Stringlist:AppendPrivateKeyInfo footer}} |
Revision as of 19:48, 7 May 2012
Add RSA private key information to a Stringlist (Stringlist class)
[Requires Janus Network Security]
This callable method adds lines from the information section of an SSL private key to the end of a Stringlist.
Syntax
[%number =] sl:AppendPrivateKeyInfo[( [sl], [[Password=] string])]
Syntax terms
%number | An, optional, numeric variable that is set to zero if the function is a success. |
---|---|
sl | A Stringlist object to receive the private key information. |
sl | A Stringlist object that contains the base-64 encoded text of an RSA private key. |
Password | This optional, name allowed, parameter is a string that contains |
Usage notes
Examples
In the following example, a private key is hard-coded into one Stringlist, then the information contained in the private key is extracted via AppendCertificateInfo into another Stringlist:
b %sl is object stringlist %pkey is object stringlist %sl = new %pkey = new text to %pkey raw ----BEGIN RSA PRIVATE KEY----- MIIEogIBAAKCAQEAm6TwmSXt4+lyrhwy9SBq2LVjdTeJ5kUbU9jzmBCfw/NuC1tX YAAdc0UG5DDJYPHkWkYa7+z50SYzmoxKI8PfCLyxSOPeVW9CEhRSyiIIlyjQikIK a0YMeOXVetGiutl/y346yQYltkbQXb1SOogTg07fTRs7NWcQ4Rrcd6DEnSkrHxbv T04Z0MwoSojA+NRyBCMpa+w+R0dzrBNZIT11WOccecYjEyuPSS2ydcdgr/Rp4WKC UHmRulXWQjhEjwqFPRG4f8BkYJGr8lN262M4ti4Z11KV/lYA/lEpYUkmCaY936p4 IoVoQy8GFn7mj50sxwSa446bTvKlVPsySMDK2wIBAwKCAQAZ8NLEMPz7UZMdBLMo ... aQmxZUwUo7em8Ci6dX17AoGAcmpQ5AUj5vMdRnOmiIhLM+jgbbQjBD+52hwbkkIn sZ00cQ5asvdrHt3ziIqN7RMu5okuwdFTdk5IGHTA43qykel0e7wxwADI7qybJXWF rsIve5XyKCD55gAM4W8y4+CLkCv6dPwmkTq4vfdaYr0/NPIvigzUq0NEXFVPJfQc GncCgYEAlFIEKq0mVWLBtZRwNjehKOaWGkVVHJnoWqlBngfamQkOiGvWScQ0MVbw K3U00KpuNHRF5RVy035uoU2tnQDLyG+RmUO7j2+t90MOmgXqiZlTz08uf/fQaprd NzpmjANA/9cT3rwHD31LsjaDXASM5IW0q7h+vhvVLtVkDzDnW5w= -----END RSA PRIVATE KEY----- end text %sl:appendPrivateKeyInfo(%pkey) %sl:print end
The result is something like:
ALG=RSA N=9BA4F09925EDE3E972AE1C32F5206AD8 ... A461AEFECF9D126339A8C4A23C3DF08B- CB148E3DE556F42121452CA22089728D08 ... 4D1B3B356710E11ADC77A0C49D292B1F- 16EF4F4E19D0CC284A88C0F8D472042329 ... 2507991BA55D64238448F0A853D11B87- FC0646091ABF25376EB6338B62E19D7529 ... E38E9B4EF2A554FB3248C0CADB E=03