You can store your certificates in any SCM, including Git, without any problems. Storing a private key in SCM is not a good practice; you will need to find a way to restrict access only to those who need access to private keys (and this should be a small number of people). You have two main options:
- securely store secret keys; or,
- Recover key pairs on each client.
This is not considered best practice, but you can store secret keys encrypted in the PKCS-12 archive (protected by a strong password known only to those who need access to private keys) before placing them in a repository such as SCM or FS and etc. When a new service is created, the final step in the build process is for the system administrator to manually decrypt the keystore.
It is best to regenerate keys for new service instances, but this requires sending your CSR for the new service to your CA after the build is complete.
Both scenarios require manual work to complete the installation process. In an attempt to automate this process, some encode the PKCS-12 password in a script setup - this is not considered best practice.
Here is the Puppet plugin that can help in this process:
https://github.com/puppetlabs/puppetlabs-java_ks
Jan nielsen
source share