If you configured Blesta with a Private Key Passphrase, and you've forgotten it, you'll be unable to process Credit Card and ACH payments. You will also be unable to recover any Credit Card or ACH payment details. However, this guide will walk you through the steps for regenerating an encryption key set that will allow you to again begin accepting and processing new Credit Card and ACH payments.
Regenerating a new encryption key pair
- Determine which company_id you need to generate a new encryption key pair for. You can find this under System > Companies. Click edit and look for the number at the end in the URL bar.
Remove the existing private_key, public_key, and private_key_passphrase values stored for your company_id from the company_setting table. The following is a query that will do just that (replace COMPANYID with your actual company ID).
Remove key pair queryUPDATE `company_settings` SET `value`='' WHERE `company_id`=COMPANYID AND `key` IN ('private_key', 'public_key', 'private_key_passphrase')
- Find your API key. If you don't already have an API user, create one.
- SSH into your server and navigate to the directory where Blesta is installed.
Execute the following command, replacing USER with your API username, KEY with your API user key, and COMPANYID with your company ID.
php index.php api/companies/generateKeyPair.json -u USER -k KEY -m POST -p "company_id=COMPANYID&bits=3072"
Generating encryption keys is hard work. This make take a minute or so to complete. You should receive output similar to
{"response":{"privatekey":"-----BEGIN RSA PRIVATE KEY-----\nMIIG4wIBAAKCAYEAr8kl 87IAUSUFaXVNARrPvx1PzZhYU+f7i2xQvIqnVwLfmTU+\n6myDcmCerTWru3XpFciWl2nEeR52DAQaaR 7YwZr8L4chJmly9AbIUuxW1eml59y+\nytz+Yl6fdxfVpmSSeYUv6+xX6CFaF49R3OkFhcm6FxzY9RxM ...
- You're done! You can not go back into Blesta and set a new Private Key Passphrase if you want.
Related articles