tsNetGenerateKey

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
tsNetGenerateKey(<pKeyLength>, <rPrivateKey>, <rPublicKey>, <pPassphrase>, [<pFormat])
Associationstsnet
Summary

Generates an RSA public/private key for use with SFTP transfers.

EditionBusiness
Introduced8.1
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
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".

Example
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
Values
NameTypeDescription
return

The tsNetGenerateKey function returns an empty string if successful, otherwise an error string will be returned.

RelatedLibrary: tsNet
Description

Generates an RSA public/private key for use with SFTP transfers.

Tagsexternals