Solved

keytool and private key

Posted on 2014-04-13
3
564 Views
Last Modified: 2014-04-14
On a previous post I wrote

Could some one please post an example of a keytool creating a private key (and please explain what about the command makes the key private instead of public)

Open in new window


I was given an excellent reply


there is no such command. you always generate a keypair, which generates both a private and a public key. the difference is that in the standard sun keytool, there is no way to extract the private key, you can merely export either a certificate or a CSR with the public key. 

Open in new window


But this led me to wonder....   What if I need to export a private key.  How do I do it.  

Also, when I use the keytool to create a certificate, can I assume the certificate contains the public key ?

Thanks
0
Comment
Question by:Anthony Lucia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 29

Assisted Solution

by:becraig
becraig earned 500 total points
ID: 39997828
So the comment you got is correct.

Once you have the Key "Pair" public and private you can extract the "public key portion"

You can also export the private key for use with a system that will validate ssl communications.

But this led me to wonder....   What if I need to export a private key.  How do I do it.  
You can use several tools to do this including the mmc in microsoft windows, openssl commands among other things (it will be exported in pkcs / pfx format [password] protected])

Also, when I use the keytool to create a certificate, can I assume the certificate contains the public key ?
Yes once a certificate is created you will have a matching pair public / private since that is what drives the SSL certificate concept key pairs.
0
 
LVL 29

Accepted Solution

by:
becraig earned 500 total points
ID: 39997833
0
 
LVL 33

Expert Comment

by:Dave Howe
ID: 39998490
easiest is the keytool iui gui tool
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Ransomware continues to grow in reach and sophistication, putting data everywhere at risk. Learn how to avoid being caught in its sinister clutches with these 11 key tips.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question