Reputation: 2049
how can I convert an openssh dsa public key to .pem format?
is it possible?
I've used command
openssl dsa -in u015_test.pub -outform pem > u015_test.pem
but this is the output:
read DSA key
unable to load Private Key
23392:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:648:Expecting: ANY PRIVATE KEY
unable to load Key
this is how my key appears:
ssh-dss AAAAB3NzaC1kc3MAAACBAMMjZ03z7hOuGYDaPmyBvuNS+LJmhYn1bWzWP8p+1/amuRPdHj68KnRDuaf8MJB3qBZ6xsu97vUjjuRDeEyFLVjsghK9TiKBsxv2Uv+fS4o0OJzP............
Upvotes: 1
Views: 5036
Reputation: 69012
To convert ssh keys, you should use ssh-keygen
:
ssh-keygen -e -m PEM -f u015_test.pub
or if you want to use the key with openssl:
ssh-keygen -e -m PKCS8 -f u015_test.pub
To try if it works, use:
ssh-keygen -e -m PKCS8 -f u015_test.pub | openssl dsa -pubin
Upvotes: 3