Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: OpenSSH: Dev

Convert pem key to ssh-rsa format

 

 

OpenSSH dev RSS feed   Index | Next | Previous | View Threaded


adrya1984 at gmail

Jun 18, 2009, 1:29 AM

Post #1 of 3 (6227 views)
Permalink
Convert pem key to ssh-rsa format

Hi

I have a certificate in der format, from it with this command i
generate a public key:

openssl x509 -inform der -in ejbcacert.cer -noout -pubkey > pub1key.pub

result is this:

-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC7vbqajDw4o6gJy8UtmIbkcpnk
O3Kwc4qsEnSZp/TR+fQi62F79RHWmwKOtFmwteURgLbj7D/WGuNLGOfa/2vse3G2
eHnHl5CB8ruRX9fBl/KgwCVr2JaEuUm66bBQeP5XeBotdR4cvX38uPYivCDdPjJ1
QWPdspTBKcxeFbccDwIDAQAB
-----END PUBLIC KEY-----

How can i obtain a public key like this? Either from certificate or
from this public key?

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC7vbqajDw4o6gJy8UtmIbkcpnkO3Kwc4qsEnSZp/TR+fQi62F79RHWmwKOtFmwteURgLbj7D/WGuNLGOfa/2vse3G2eHnHl5CB8ruRX9fBl/KgwCVr2JaEuUm66bBQeP5XeBotdR4cvX38uPYivCDdPjJ1QWPdspTBKcxeFbccDw==

This was obtained with this command:

ssh-keygen -y -f private_key1.pem > public_key1.pub

Need some help please...

Thanks,
Adriana
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


djm at mindrot

Jun 19, 2009, 2:52 AM

Post #2 of 3 (6108 views)
Permalink
Re: Convert pem key to ssh-rsa format [In reply to]

On Thu, 18 Jun 2009, Adriana Rodean wrote:

> Hi
>
> I have a certificate in der format, from it with this command i
> generate a public key:
>
> openssl x509 -inform der -in ejbcacert.cer -noout -pubkey > pub1key.pub
>
> result is this:
>
> -----BEGIN PUBLIC KEY-----
> MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC7vbqajDw4o6gJy8UtmIbkcpnk
> O3Kwc4qsEnSZp/TR+fQi62F79RHWmwKOtFmwteURgLbj7D/WGuNLGOfa/2vse3G2
> eHnHl5CB8ruRX9fBl/KgwCVr2JaEuUm66bBQeP5XeBotdR4cvX38uPYivCDdPjJ1
> QWPdspTBKcxeFbccDwIDAQAB
> -----END PUBLIC KEY-----
>
> How can i obtain a public key like this? Either from certificate or
> from this public key?

I'm not sure of what you are after: an OpenSSH public key, a PEM public
key or something else?

You can extract a PEM public key from an OpenSSH private key using:

openssl rsa -pubout -in .ssh/id_rsa

But OpenSSH has no tools to convert from or too PEM public keys (note: PEM
private keys are OpenSSH's native format for protocol 2 keys).

-d
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


adrya1984 at gmail

Jun 19, 2009, 7:23 AM

Post #3 of 3 (6109 views)
Permalink
Re: Convert pem key to ssh-rsa format [In reply to]

Hi,

I want from a .cer certificate or pem certificate that contains a
public key, to obtain a openssh public key.
Like this:
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQC7vbqajDw4o6gJy8UtmIbkcpnkO3Kwc4qsEnSZp/TR+fQi62F79RHWmwKOtFmwteURgLbj7D/WGuNLGOfa/2vse3G2eHnHl5CB8ruRX9fBl/KgwCVr2JaEuUm66bBQeP5XeBotdR4cvX38uPYivCDdPjJ1QWPdspTBKcxeFbccDw==

I don't want to extract it from private key...
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev [at] mindrot
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

OpenSSH dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.