How do I set a permanent default key in Command Line for encryption
search cancel

How do I set a permanent default key in Command Line for encryption

book

Article ID: 153208

calendar_today

Updated On:

Products

PGP Command Line

Issue/Introduction


This article describes how to configure Command Line to use a different key on your keyring to be the permanent default key. The --default-key option only specifies the default key to be used for that specific Command Line operation and is not persistent.
 

Resolution


To configure a default key you will need to located and edit the PGPprefs.xml file.  If you have specified a PGP_HOME_DIR environmental variable this will be located in that directory.

After you locate this file you should modify the following section:

    <key>CLdefaultKey</key>
    <string></string>

In between the string section you should add the key id of the key that you would like to use as your permanent default key.

    <key>CLdefaultKey</key>
    <string>0x01234567</string>

If you haven't specified a PGP_HOME_DIR variable then you can have a different default key for each different PGPprefs.xml file. If you have specified a PGP_HOME_DIR variable then each user will share a single PGPprefs.xml file and the change will be global to your system.