Subject: | broken error message |
Hi,
I have to wrap a base64 encoded key (originating from XML WSS) to import
it as public key.
my $key = Crypt::OpenSSL::RSA->new_public_key(<<__PUBLIC_KEY);
-----BEGIN$wrap PUBLIC KEY-----
$key
-----END$wrap PUBLIC KEY-----
I got this error:
RSA.xs:178: OpenSSL error: (null) at blib/lib/Crypt/OpenSSL/RSA.pm
(autosplit into blib/lib/auto/Crypt/OpenSSL/RSA/new_public_key.al) line 91.
I found-out that the cause was simple: $key has already a \n at the end
of its own, do now there was a blank line before the END. Maybe you are
able to improve the error message.
Thanks for your module! (now used in XML::Compile::WSS::Signature)