AppendPrivateKeyInfo (Stringlist function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
Line 8: Line 8:
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table class="syntaxTable">
<tr><th>%number</th><td>An, optional, numeric variable that is set to zero if the function is a success. </td></tr>
<tr><th>%number</th><td>An, optional, numeric variable that is set to zero if the function is a success. The possible return codes are described below in [[#Return codes|"Return codes"]]. </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>

Revision as of 19:21, 8 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

%numberAn, optional, numeric variable that is set to zero if the function is a success. The possible return codes are described below in "Return codes".
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 a password to decrypt the private key, if necessary.

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

See also