In Ubuntu, i can convert a Pub key from OpenSSH-format to PKCS8 format by command:
ssh-keygen -e -f .ssh/id_rsa.pub -m PKCS8
But in CentOS 6.4, when i execute the same command, it notice:
ssh-keygen: illegal option — m
I read man-page of ssh-keygen on Centos 6.4 and saw that it does not have option "-m".
Then, how can I accomplish the same task on Centos 6.4?
Thank you very much!
Best Answer
In RHEL systems and derivatives, you can use
openssl
for this task:Moreover, the
pkcs8(1)
manpage provides several examples.This Q/A in the SEC.SE site provides a very detailed description of this process and the cryptography involved.