How can I get the private key needed to create the .p12 file?

This question is in reference to Atlassian Documentation: Running Confluence Over SSL or HTTPS

The keytool program does not generate a private or public key for me.  different attempts of "-genkeypair" and "-genkey" did not product a public key or private key.

The private key is needed to create the .p12 file.

This is a large headache for me as I'm not that familiar with creating keystores or configuring ssl certificates.

Many sites repeat the same information stating that the "keytool -genken" command creates the keypair.  When the file was inspected, there was no key to be found.  Only the information related to the "self signed certificate" (MyDomain, MyCompany, etc).

If ten people tell me I'm crazy.  I must be crazy, but "how" can I be crazy?

1 answer

1 accepted

The solution was to use the openssl command to create the key and csr at the same time.

openssl req -new -newkey rsa:2048 -nodes -out <MyDomain.csr> -keyout <MyDomain.key> -subj "/C=<MyTwoLetterCountryCode>/ST=<MyState>/L=<MyCity>/O=<MyOrganization>/OU=<MyDepartment>/CN=<MyDomain>"

Taken from this handy site:

https://www.digicert.com/easy-csr/openssl.htm

I don't understand why keytool doesn't create the key and openssl does create the key, but this does work for me.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jul 10, 2018 in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

989 views 23 13
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you