Solved

How to check whether given .pem file is public key or private key

Posted on 2011-02-16
6
591 Views
Last Modified: 2012-05-11
Hello, I have one .pem file and I would like to know whether it is public or private key.. Kindly let me know the openssl command to find whether it is Private or public key. I am having linux box (Ubuntu). Thanks!
0
Comment
Question by:beer9
  • 3
  • 3
6 Comments
 
LVL 6

Accepted Solution

by:
Bxoz earned 500 total points
ID: 34910672
Do a cat on your different .pem
the private key should be like that
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
 
0
 

Author Comment

by:beer9
ID: 34910978
Thanks Bxoz? Do we have openssl command to check whether it is private/public key and also whether it uses a RSA or DSA key algorithm? Thanks!
0
 
LVL 6

Expert Comment

by:Bxoz
ID: 34911362
I don't find such function in openssl, you have all the information if you edit  or display (cat, vi, nano) your .pem files

Why do you want use openssl to do this ?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:beer9
ID: 34944290
Thanks Bxoz, I have another question. Is it always true that a private key has to be RSA?? I mean it would start with "-----BEGIN RSA PRIVATE KEY-----"? Thanks!
0
 
LVL 6

Expert Comment

by:Bxoz
ID: 34946013
No you can have for example DSA private Key

openssl dsaparam -out dsaparam.pem 2048
openssl gendsa -des3 -out privkey.pem dsaparam.pem

Open in new window

-----BEGIN DSA PRIVATE KEY-----

http://www.openssl.org/docs/HOWTO/keys.txt
0
 

Author Closing Comment

by:beer9
ID: 34987029
Thank you! :-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

So you need a certificate so you can offer SSL encryption.  But which one should you get?  There are so many choices out there! Here is a generic overview of the main types of SSL certificates sold by the majority of commercial Certification Auth…
Imagine a situation that you have installed SSL (http://en.wikipedia.org/wiki/Secure_Sockets_Layer) Certificate on your Cisco ASA (Cisco Adaptive Security Appliance) firewall. Installation of SSL certificate on ASA is an another topic for which you …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
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…

895 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now