Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: AES support for Crypt::OpenSSL::RSA?

by kschwab (Priest)
on Feb 04, 2014 at 04:10 UTC ( #1073296=note: print w/replies, xml ) Need Help??


in reply to AES support for Crypt::OpenSSL::RSA?

I think that Convert::PEM can do what you're looking for. See the code snippet below borrowed from stuff-things.net Use the return value from decryptPEM($file,$password); as the value of your $key_string variable in your code.
# # borrowed from # http://stuff-things.net # use Convert::PEM; sub decryptPEM { my ($file,$password) = @_; my $pem = Convert::PEM->new( Name => 'RSA PRIVATE KEY', ASN => qq( RSAPrivateKey SEQUENCE { version INTEGER, n INTEGER, e INTEGER, d INTEGER, p INTEGER, q INTEGER, dp INTEGER, dq INTEGER, iqmp INTEGER } )); my $pkey = $pem->read(Filename => $file, Password => $password); return(undef) unless ($pkey); # Decrypt failed. $pem->encode(Content => $pkey); }

Replies are listed 'Best First'.
Re^2: AES support for Crypt::OpenSSL::RSA?
by Zippy1970 (Novice) on Feb 04, 2014 at 10:28 UTC

    Re: Convert::PEM

    I had found that code too but for some reason it always returned undef (Decrypt failed).

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1073296]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2018-02-19 14:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (265 votes). Check out past polls.

    Notices?