LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-29-2012, 11:06 AM   #1
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 205

Rep: Reputation: 27
Arrow Unable to load Public Key (OpenSSL RSA, Debian Squeeze)


Hi everyone,
Here's my public key (pub.pem):
Code:
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArnXhdXgd38iiwFqjSRT4
oi5g4XboKsxORJr21ip17AILoiEyNmXojY6DonvohIMn1Nr4iw6ScMt/7gVk3Z3Y
CLcPuJV6SMb6TRxE6NnCg9q/6Nxq21X7aUDwdP6L98PaCpU7879pHXCS5t3E+xw7
hDIzikL1nfQrY4kgsZLM75HsYzewBu8Hl2CTibUlLItz5h+yTC/tiG7cQRJdVKCw
bp3DwYgfvbhd9WYaPM3ESg8ho/MstAKtgdiRDWESPP+yWDGWU5ymhoETwKNEOsme
AujhInHW7qgzhfALvBRw3hc0lDFKeByJ/0Re4mm4et/tsnxp/5Px6qwbNacZORMj
WwIDAQAB
-----END PUBLIC KEY-----
And here's the command I'm using to try to encrypt a message (contained in file "archivo") and save the result to file "encriptado":
Code:
openssl rsautl -encrypt -inkey pub.pem -pubin -in archivo -out encriptado
But I keep getting the error: "Unable to load Public Key".
Any ideas on why this is happening?
 
Old 11-29-2012, 12:17 PM   #2
gacanepa
Member
 
Registered: May 2012
Location: San Luis, Argentina
Distribution: Debian
Posts: 205

Original Poster
Rep: Reputation: 27
Quote:
Originally Posted by gacanepa View Post
Hi everyone,
Here's my public key (pub.pem):
Code:
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArnXhdXgd38iiwFqjSRT4
oi5g4XboKsxORJr21ip17AILoiEyNmXojY6DonvohIMn1Nr4iw6ScMt/7gVk3Z3Y
CLcPuJV6SMb6TRxE6NnCg9q/6Nxq21X7aUDwdP6L98PaCpU7879pHXCS5t3E+xw7
hDIzikL1nfQrY4kgsZLM75HsYzewBu8Hl2CTibUlLItz5h+yTC/tiG7cQRJdVKCw
bp3DwYgfvbhd9WYaPM3ESg8ho/MstAKtgdiRDWESPP+yWDGWU5ymhoETwKNEOsme
AujhInHW7qgzhfALvBRw3hc0lDFKeByJ/0Re4mm4et/tsnxp/5Px6qwbNacZORMj
WwIDAQAB
-----END PUBLIC KEY-----
And here's the command I'm using to try to encrypt a message (contained in file "archivo") and save the result to file "encriptado":
Code:
openssl rsautl -encrypt -inkey pub.pem -pubin -in archivo -out encriptado
But I keep getting the error: "Unable to load Public Key".
Any ideas on why this is happening?
I was able to find the solution to this issue. I uploaded the public key from the computer where I generated it in the first place to another one, and it worked. It seems that simply copying and pasting the public key's contents in a file named pub.pem (located in the remote computer) isn't the way to go.
 
  


Reply



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
Retrieving a public RSA key through the command line caseydk Linux - Newbie 4 06-30-2011 02:13 AM
Putty/SSH login failed when using RSA public key: 'Server refused our key' itsecx@gmail.com Linux - Server 10 10-04-2010 01:19 PM
Which is better RSA or DSA public key? tarballedtux Linux - Security 12 02-03-2009 06:15 AM
RSA public key encryption/private key decription koningshoed Linux - Security 1 08-08-2002 07:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:03 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
Open Source Consulting | Domain Registration