<< back to sysax.com Product page

7.3. Keyrings and key management

Public and private key files used for OpenPGP encryption and decryption are stored in keyring files. The Sysax FTP Automation program maintains a default keyring. When a keyring file name is not explicitly specified, the default keyring is used. The -pgexportpublickey option is used to export a public key and the -pgpexportprivatekey option is used to export a private key.

Exhibit 7.3. Syntax of commands for keyrings and key management

sysaxftp.exe -pgpexportpublickey <username or email> -pgpkeyout <output filename> [-keyring <keyring file name>]

sysaxftp.exe -pgpexportprivatekey <username or email> -pgpkeyout <output filename> [-keyring <keyring file name>]

Exhibit 7.4. Examples for using the commands for keyrings and key management

sysaxftp.exe -pgpexportpublickey john.doe -pgpkeyout keyout.pub -keyring mykeyring.pgp    #export public key for user john.doe from mykeyring.pgp

sysaxftp.exe -pgpexportprivatekey john.doe -pgpkeyout keyout.priv    #export private key for user john.doe from default keyring

The -pgpimportpublickey option is used to import a previously exported public key or a public key from a user to whom a file or message needs to be sent. The -pgpimportprivatekey option is used to import a previously exported private key.

Exhibit 7.5. Syntax of commands for keyrings and key management

sysaxftp.exe -pgpimportpublickey <public key filename> [-keyring <keyring file name>]

sysaxftp.exe -pgpimportprivatekey <private key filename> [-keyring <keyring file name>]

Exhibit 7.6. Examples for using the commands for keyrings and key management

sysaxftp.exe -pgpimportpublickey key.pub -keyring mykeyring.pgp    #import public key from key.pub to mykeyring.pgp

sysaxftp.exe -npgpimportprivatekey key.priv    #import private key from key.priv to default keyring

The pgpexportpublic and pgpexportprivate commands can be used to export public and private keys from within a script.

The pgpresult predefined status flag is set to the predefined constant success if the corresponding command completed successfully.

Exhibit 7.7. Syntax of commands for keyrings and key management

pgpexportpublic <username or email>, <output filename>, [<optional keyring file>];

pgpexportprivate <username or email>, <output filename>, [<optional keyring file>];

Exhibit 7.8. Examples for using the commands for keyrings and key management

pgpexportpublic "john.doe", "keyout.pub", "mykeyring.pgp";    #export public key for user john.doe from mykeyring.pgp

pgpexportprivate "john.doe", "keyout.priv";    #export private key for user john.doe from default keyring

The pgpimportpublic and pgpimportprivate can be used to import public and private keys from within a script.

The pgpresult predefined status flag is set to the predefined constant success if the corresponding command completed successfully.

Exhibit 7.9. Syntax of commands for keyrings and key management

pgpimportpublic <key file to import>, [<optional keyring file>];

pgpimportprivate <key file to import>, [<optional keyring file>];

Exhibit 7.10. Examples for using the commands for keyrings and key management

pgpimportpublic "key.pub", "mykeyring.pgp";    #import public key from key.pub to mykeyring.pgp

pgpimportprivate "key.priv";    #import private key from key.priv to default keyring