[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2011-02-16
6
Medium Priority
?
605 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
[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
  • 3
  • 3
6 Comments
 
LVL 6

Accepted Solution

by:
Bxoz earned 2000 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
Looking for the Wi-Fi vendor that's right for you?

We know how difficult it can be to evaluate Wi-Fi vendors, so we created this helpful Wi-Fi Buyer's Guide to help you find the Wi-Fi vendor that's right for your business! Download the guide and get started on our checklist today!

 

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

Tech or Treat!

Submit an article about your scariest tech experience—and the solution—and you’ll be automatically entered to win one of 4 fantastic tech gadgets.

Question has a verified solution.

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

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…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

656 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