mgr007 has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to verify a xml signed document. Reading the x.509 certificate works fine, as well as extracting the public key. But if try to read the key with
Crypt::OpenSSL::RSA->new_public_keyI will get the error message
RSA.xs:178: OpenSSL error: expecting an rsa key at blib/lib/Crypt/OpenSSL/RSA.pm (autosplit into blib/lib/auto/Crypt/OpenSSL/RSA/new_public_key.al) line 91, <STDIN> line 1.My code is:
... $x509 = Crypt::OpenSSL::X509->new_from_string($cert); $rsa = Crypt::OpenSSL::RSA->new_public_key($x509->pubkey); ...
$x509->pubkey seems correctly pem encoded (starting with "-----BEGIN PUBLIC KEY-----" ) and comes from a http://www.w3.org/2000/09/xmldsig signature compliant certificate.
Is there a difference between a rsa public key and a x.509 public key ?
What's the problem ? Do you have an idea ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Crypt::OpenSSL::RSA->new_public_key does not accept a x.509 public key
by CountZero (Bishop) on Sep 16, 2015 at 19:41 UTC |