Back to product page

PublicKeySave method

Saves public key a the file.




  • Basic
object.PublicKeySave KeyType, Filename
The PublicKeySave(object,KeyType,Filename) 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 PublicKeySaved.


The settings for KeyType are:

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

PublicKeySave method will store contents of your public key from memory to file on your disk drive, in X509 PEM format.

Key is saved using PEM format, as base64 encoded data surrounded by header lines, which makes it exportable (and importable) to other SSH engines. Written file contains only plain ASCII characters.