tsNetGenerateKey
Type
function
Summary
Generates an RSA public/private key for use with SFTP transfers.
Syntax
tsNetGenerateKey(<pKeyLength>, <rPrivateKey>, <rPublicKey>, <pPassphrase>, [<pFormat])
Description
Generates an RSA public/private key for use with SFTP transfers.
Parameters
Name | Type | Description |
---|---|---|
pKeyLength | The length of the RSA key to generate. | |
rPrivateKey | A variable to store the RSA private key in. | |
rPublicKey | A variable to store the RSA public key in. | |
pPassphrase | The passphrase to protect the RSA private key with. Can be blank. | |
pFormat | Specifies the format that the generated keys are returned it. Accepts "PKCS#8" or "PKCS#1", the default is "PKCS#1". |
Examples
local tPrivKey, tPubKey, tResult
put tsNetGenerateKey(2048, tPrivKey, tPubKey, "secretkey", "PKCS#8") into tResult
if tResult is not empty then
answer "Failed to generate RSA key"
end if
Related
library: tsNet
Compatibility and Support
Introduced
LiveCode 8.1
OS
mac
windows
linux
ios
android
Platforms
desktop
server
mobile