Search code examples
ruby-on-railsherokusign

Securely store p12 file in rails


How do I securely store my p12 file in rails? My production web app will be in Heroku. The file is used to sign some documents dynamically.


Solution

  • Storing the p12 contents in an environment variable should be sufficiently secure on Heroku. This way it's at least not available in your code base or through your database.

    You can setup Heroku environment variables like this:

    heroku config:add P12_CONTENTS="$(cat /path/to/file.p12)"