LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices



Reply
 
Search this Thread
Old 06-18-2009, 01:03 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Rep: Reputation: 83
Question RSA to PKCS


Hi!

I'm trying to set up a public RSA key on a router. Now, in the instructions, it says that I need to encode the public key to PKCS. It says I can use sshkey.exe, but i refuse to use something on windows.... even more, I expect to learn how to do it on GNU/Linux. How can I do it?

Thanks in advance
 
Old 06-20-2009, 02:52 PM   #2
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Check the rsa(1) manpages. It looks like you could probably use:

$ openssl rsa -outform DER -in key.here -out new.key.here

I have not tested that. It might require some more investigation and some tweaking.

-------

edit: Also check the pkcs8(1) manpages...

Last edited by anomie; 06-20-2009 at 02:54 PM.
 
Old 06-30-2009, 03:01 PM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
Anomie, thanks for your reply. I retook this problem. See, when i try to generate the pkcs from the private key, it works. However, when i try with the private key, it complains. See:

Code:
$ openssl rsa -outform DER -in id_rsa -out id_rsa.priv.pkcs
writing RSA key
$ openssl rsa -pubin -outform DER -in id_rsa.pub -out id_rsa.pub.pkcs
unable to load Public Key
11146:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:647:Expecting: PUBLIC KEY
Both files (id_rsa and id_rsa.pub) where generated in a single ssh-keygen execution. Any idea what I'm missing?
 
Old 06-30-2009, 03:12 PM   #4
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Original Poster
Rep: Reputation: 83
I think I got it. I have to use the private key as input and tell it to put out the public key:

Code:
$ openssl rsa -outform DER -pubout -in id_rsa -out id_rsa.pub.pkcs
writing RSA key

Last edited by eantoranz; 06-30-2009 at 04:30 PM. Reason: typo
 
  


Reply

Tags
keys, rsa


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
evolution pkcs#12 Lobais Linux - Software 2 10-02-2006 09:09 AM
Which is easier to install on Linux PGP, x.509/PKCS, SAML, or SSO Web Services sdonohue Linux - Software 2 09-26-2006 05:12 PM
how to GENERATE A PKCS #10 certificate USING RED HAT 7.3 cesemj Linux - Security 1 02-03-2006 04:12 PM
HOW TO GENERATE A PKCS #10 certificate USING RED HAT 7.3 cesemj Linux - General 1 02-03-2006 03:28 PM


All times are GMT -5. The time now is 11:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration