beer9
asked on
How to check whether given .pem file is public key or private key
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!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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 ?
Why do you want use openssl to do this ?
ASKER
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!
No you can have for example DSA private Key
http://www.openssl.org/docs/HOWTO/keys.txt
openssl dsaparam -out dsaparam.pem 2048
openssl gendsa -des3 -out privkey.pem dsaparam.pem
-----BEGIN DSA PRIVATE KEY-----http://www.openssl.org/docs/HOWTO/keys.txt
ASKER
Thank you! :-)
ASKER