Saturday, April 18, 2015

Certificate Management

Certificate creation

Use XCA (http://sourceforge.net/projects/xca)

Create Certification Authority root certificate

  • Create a new database
  • Create a new key by using the CA template (RSA, minimum 2048 bits length)
  • Create a new certificate for CA (using previously created key, minimum SHA256 signing algorithm - SHA1 is about to be not supported anymore starting from 2017)

Create certificates

  • Create a new Template based on HTTPS server existing template (depending on your future needs)
  • Create certificates:
    • Go to Templates tab->right click->Create certificate;if using the option to create a new certificate from Certificates tab do not forget to select a template and click one of the Apply options buttons
    • Change the default option for signing the certificate (->Use this certificate...; select the CA certificate)
    • Change the default signing algorithm to something >SHA1
    • On Subject tab:
      • Change the relevant fields (commonName especially)
      • Create a new private key for certificate (Generate new key button)

Misc operations

Apart from exporting certificates to different formats (including or not private key, including or not certificate chain) you can obtain the public or private key in PEM format by going to Private Keys tab ->right click a key->Export to clipboard, etc

Managing a JKS Store

Use KeyStore Explorer (http://keystore-explorer.sourceforge.net/). An alternative would be to use Poretcle but KeyStore has the advantage (from my point of view) that being a Windows application can be registered as default for JKS files.

Import now the trusted CA certificates (*.cer or *.crt for instance) and the key pairs (certificates containing the private key) (*.p12 for instance).

IyBDZXJ0aWZpY2F0ZSBjcmVhdGlvbg0KDQpVc2UgKipYQ0EqKiAoW2h0dHA6Ly9zb3VyY2Vmb3JnZS5uZXQvcHJvamVjdHMveGNhXShodHRwOi8vc291cmNlZm9yZ2UubmV0L3Byb2plY3RzL3hjYSkpDQoNCiMjIENyZWF0ZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSByb290IGNlcnRpZmljYXRlDQoqIENyZWF0ZSBhIG5ldyBkYXRhYmFzZQ0KKiBDcmVhdGUgYSBuZXcga2V5IGJ5IHVzaW5nIHRoZSBDQSB0ZW1wbGF0ZSAoUlNBLCBtaW5pbXVtIDIwNDggYml0cyBsZW5ndGgpDQoqIENyZWF0ZSBhIG5ldyBjZXJ0aWZpY2F0ZSBmb3IgQ0EgKHVzaW5nIHByZXZpb3VzbHkgY3JlYXRlZ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