Back to product page

Save method


Saves keys to the file.

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 SSHKeyPair.
KeyTypeRequired. A SSHKeyTypes enumeration, as described in settings. Type of the key (RSA, DSA or ECDSA).
FIlenameRequired. A String value. Full path to file where key will be saved.
PasswordOptional. A Variant value. Secret password that is used to protect the key.
Return valueNone

Remarks

Save method will store contents of private key from memory to file on your disk drive. Key is saved using PEM format, simply base64 encoded data surrounded by header lines, which makes it exportable (and importable) to other SSHD engines. Optionally (and suggested) you can specify the password to be used when key is written to disk, so only yourself (and the server) can read saved key. Don't forget to use the same password when Loading key from disk.

Written file contains only plain ASCII characters.

The settings for KeyType are:

Constant Value Description
RSAkey0 Uses RSA cipher to create keys.
DSAkey 1 Uses DSA cipher to create keys.
ECDSAkey 2 Uses ECDSA cipher to create keys.

Platforms

Windows