Back to product page

Save method


Saves keys to the file.

Type

None

Syntax

  • Basic
object.Save KeyType, Filename, [Password]
The Save(object,KeyType,Filename,Password) syntax has these parts:
objectAn expression evaluating to an object of type Keys.
KeyTypeRequired. A SSHKeyTypes enumeration, as described in settings. Type of the key.
FilenameRequired. A String value. Full path to file where key should be saved.
PasswordOptional. A Variant value. Secret password to protect the key.

Remarks

The settings for KeyType are:

Constant Value Description
RSAkey 0 RSA key is saved.
DSAkey 1 DSA key is saved.
ECDSAkey 2 ECDSA key is saved.


Save method will store contents of your private key from memory to file on your disk drive.

Key is saved using PEM format, as base64 encoded data surrounded by header lines, which makes it exportable (and importable) to other SSH engines. Optionally (and is suggested) you can specify the password to be used when key is written to disk, so only you can read saved key. Don't forget to use the same password when Loading key from disk.

Written file contains only plain ASCII characters.

Platforms

Windows