Solved

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

Posted on 2011-02-16
6
597 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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

#SSL #TLS #Citrix #HTTPS #PKI #Compliance #Certificate #Encryption #StoreFront #Web Interface #Citrix XenApp
SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 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