GeneratedPrivateKey (System function): Difference between revisions
No edit summary |
m (→See also: typo) |
||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{Template:System:GeneratedPrivateKey subtitle}} | {{Template:System:GeneratedPrivateKey subtitle}} | ||
This | This method generates a binary string that contains a base64 encoded RSA private key. | ||
==Syntax== | ==Syntax== | ||
{{Template:System:GeneratedPrivateKey syntax}} | {{Template:System:GeneratedPrivateKey syntax}} | ||
===Syntax terms=== | ===Syntax terms=== | ||
<table | <table> | ||
<tr><th nowrap>%privateKey</th><td> | <tr><th nowrap>%privateKey</th> | ||
<td>A <var>[[Longstrings|Longstring]]</var> to contain the generated private key.</td></tr> | |||
<tr><th nowrap><var>%(System)</var></th> | <tr><th nowrap><var>%(System)</var></th> | ||
<td>The class name in parentheses denotes a shared method. <var>GeneratedPrivateKey</var> can also be invoked | <td>The class name in parentheses denotes a shared method. <var>GeneratedPrivateKey</var> can also be invoked by a <var>System</var> object variable, which may be <var>Null</var>.</td></tr> | ||
<tr><th><var>Length</var></th> | <tr><th><var>Length</var></th> | ||
<td | <td>This optional, [[Notation conventions for methods#Named parameters|name allowed]], parameter specifies the number of bits in the private key. The value must be at least 64 and no greater than 4096 (as of version 7.7 of Model 204). The pre-7.7 maximum is 2048. The default is 512. </td></tr> | ||
<tr><th><var>Exponent</var></th> | <tr><th><var>Exponent</var></th> | ||
<td>number | <td>This optional, name allowed, parameter specifies the number of bits in the public exponent (E). This must be either 3 or 65537 (X'10001'). The default is 3. </td></tr> | ||
<tr><th><var>Salt</var></th> | <tr><th><var>Salt</var></th> | ||
<td | <td>This optional, name allowed, parameter is a string that contains seed data for a random number generator. </td></tr> | ||
</table> | </table> | ||
==Usage notes== | ==Usage notes== | ||
<ul> | |||
<li><var>GeneratedPrivateKey</var> is available for use by <var class="product">Model 204</var> V7.5 or greater or by <var class="product">[[Janus Network Security]]</var> customers. </li> | |||
</ul> | |||
==Examples== | ==Examples== | ||
In the following example, the <var>GeneratedPrivateKey</var> method loads a private key into a <var>Longstring</var>, and the <var>[[RSAPrivateKeyToXmlDoc (String function)|RSAPrivateKeyToXmlDoc]]</var> method converts the string to an <var>[[XmlDoc class|XmlDoc]]</var> from which its value is printed: | |||
<p class="code">b | |||
%ls is longstring | |||
%ls = %(System):generatedPrivateKey(Length=512) | |||
%ls:RSAPrivateKeyToXmlDoc:print | |||
end </p> | |||
The abridged result is: | |||
<p class="output"><RSAPrivateKey> | |||
<version>0</version> | |||
<modulus>706553134510188719773478...646666609227038206204678- | |||
3048982833206545570198865800641</modulus> | |||
<publicExponent>3</publicExponent> | |||
<privateExponent>117758855751698119962246...007474103727312496471840- | |||
79091490411449986244635754425221262047</privateExponent> | |||
<prime1>970312240057382430639696...483343374581910562955981</prime1> | |||
<primes>728170897306628332097444...175185025722775027121861</primes> | |||
<exponent1>646874826704921620426464...322228916387940375303987</exponent1> | |||
<exponent2>485447264871085554731629...116790017148516684747907</exponent2> | |||
<coefficient>293321615964898127953921...427209935179196862872503</coefficient> | |||
</RSAPrivateKey></p> | |||
==See also== | ==See also== | ||
<p> | |||
<var>System</var> methods: </p> | |||
<ul> | |||
<li><var>[[ClientCertificate (System function)|ClientCertificate]]</var> </li> | |||
<li><var>[[GeneratedPrivateKey (System function)|GeneratedPrivateKey]]</var> </li> | |||
</ul> | |||
<p> | |||
<var>Stringlist</var> methods: </p> | |||
{{Template:Stringlist crypto methods}} | |||
<p> | |||
<var>String</var> methods:</p> | |||
<ul> | |||
<li><var>[[CertificateRequest (String function)|CertificateRequest]]</var> </li> | |||
<li><var>[[SignedCertificate (String function)|SignedCertificate]]</var> </li> | |||
<li><var>[[DerToXmlDoc (String function)|DerToXmlDoc]]</var> </li> | |||
<li><var>[[RSAPrivateKeyToXmlDoc (String function)|RSAPrivateKeyToXmlDoc]]</var></li> | |||
<li><var>[[X509CertificateToXmlDoc (String function)|X509CertificateToXmlDoc]]</var> </li> | |||
<li><var>[[X509CrlToXmlDoc (String function)|X509CrlToXmlDoc]]</var> </li> | |||
<li>Multiple cryptographic cipher methods </li> | |||
</ul> | |||
<p> | |||
<var>Socket</var> methods: </p> | |||
<ul> | |||
<li><var>[[Certificate (Socket function)|Certificate]]</var> </li> | |||
</ul> | |||
<p><var>HttpRequest</var> methods: </p> | |||
<ul> | |||
<li><var>[[Get (HttpRequest function)|Get]]</var>, <var>[[Post (HttpRequest function)|Post]]</var>, and <var>[[Send (HttpRequest function)|Send]]</var> </li> | |||
</ul> | |||
<p>Background information: </p> | |||
<ul> | |||
<li>[https://en.wikipedia.org/wiki/RSA_(cryptosystem) RSA (cryptosystem)]</li> | |||
</ul> | |||
{{Template:System:GeneratedPrivateKey footer}} | {{Template:System:GeneratedPrivateKey footer}} |
Latest revision as of 21:46, 29 August 2016
Generate an RSA private key (System class)
[Requires Janus Network Security]
This method generates a binary string that contains a base64 encoded RSA private key.
Syntax
%privateKey = %(System):GeneratedPrivateKey[( [[Length=] number], - [[Exponent=] number], - [[Salt=] string])]
Syntax terms
%privateKey | A Longstring to contain the generated private key. |
---|---|
%(System) | The class name in parentheses denotes a shared method. GeneratedPrivateKey can also be invoked by a System object variable, which may be Null. |
Length | This optional, name allowed, parameter specifies the number of bits in the private key. The value must be at least 64 and no greater than 4096 (as of version 7.7 of Model 204). The pre-7.7 maximum is 2048. The default is 512. |
Exponent | This optional, name allowed, parameter specifies the number of bits in the public exponent (E). This must be either 3 or 65537 (X'10001'). The default is 3. |
Salt | This optional, name allowed, parameter is a string that contains seed data for a random number generator. |
Usage notes
- GeneratedPrivateKey is available for use by Model 204 V7.5 or greater or by Janus Network Security customers.
Examples
In the following example, the GeneratedPrivateKey method loads a private key into a Longstring, and the RSAPrivateKeyToXmlDoc method converts the string to an XmlDoc from which its value is printed:
b %ls is longstring %ls = %(System):generatedPrivateKey(Length=512) %ls:RSAPrivateKeyToXmlDoc:print end
The abridged result is:
<RSAPrivateKey> <version>0</version> <modulus>706553134510188719773478...646666609227038206204678- 3048982833206545570198865800641</modulus> <publicExponent>3</publicExponent> <privateExponent>117758855751698119962246...007474103727312496471840- 79091490411449986244635754425221262047</privateExponent> <prime1>970312240057382430639696...483343374581910562955981</prime1> <primes>728170897306628332097444...175185025722775027121861</primes> <exponent1>646874826704921620426464...322228916387940375303987</exponent1> <exponent2>485447264871085554731629...116790017148516684747907</exponent2> <coefficient>293321615964898127953921...427209935179196862872503</coefficient> </RSAPrivateKey>
See also
System methods:
Stringlist methods:
- AppendCertificateInfo
- AppendCertificateRequest
- AppendCertificateRequestInfo
- AppendClientCertificateRequest
- AppendEncryptedSecurityData
- AppendGeneratedPrivateKey
- AppendPemData
- AppendPrivateKeyInfo
- AppendSignedCertificate
- AppendSignedClientCertificate
- CheckCertificate
- CheckCertificateRequest
- PemToString
String methods:
- CertificateRequest
- SignedCertificate
- DerToXmlDoc
- RSAPrivateKeyToXmlDoc
- X509CertificateToXmlDoc
- X509CrlToXmlDoc
- Multiple cryptographic cipher methods
Socket methods:
HttpRequest methods:
Background information: