Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

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 Use the return value from decryptPEM($file,$password); as the value of your $key_string variable in your code.
# # borrowed from # # 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?

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2018-06-18 20:18 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (110 votes). Check out past polls.