Description of problem: It's been reported that adding 4K PGP keys to the beta can time out the UI. The key appears to be added but the test email might not be sent. User can;t cofrim as email out is disabled on beta.
This appears to be related to sub-keys not key size. When sub-keys are being used incorrect keys are being chosen. It appears the first sub-key is always selected, it should select the sub-key that: 1: matches the email address 2: is marked for encryption 3: has the longest expiry time* In version 4 keys some of that data is kept in the signatures following the certificate. * review this, IIRC there is a way in the key to set preferred certs, if set then the preferred encryption cert should be selected.
gpg dir creation can fail unless gpg_home_dir is a full path