Skip Menu |

This queue is for tickets about the Crypt-DSA CPAN distribution.

Report information
The Basics
Id: 19477
Status: open
Priority: 0/
Queue: Crypt-DSA

People
Owner: Nobody in particular
Requestors: craig [...] lucent.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Crypt::DSA::Key $key-write comment wrong for public key
I want to write a DSA public key to a file, then later read it back. I write the public key with: undef($key->{priv_key}); $key->write(Type=>'PEM', Filename=>$file); The contents of this file contains the lines: Show quoted text
-----BEGIN DSA PRIVATE KEY----- -----END DSA PRIVATE KEY----- Even though this is actually the public key. This can be very confusing to some folks. Adding the following line to the above code will fix this problem in the file: $key->{__pem}{Name}='DSA PUBLIC KEY'; However, reading it back with the following line will fail: $key=Crypt::DSA::Key->new(Filename=>$file, Type=>'PEM'); I would like to see the $key->write() code be smart enough to label the output file correctly for PUBLIC or PRIVATE keys, and the CRYPT::DSA::Key->new() code to be able to input the correctly labeled files. In addition, it would be nice for a better way to tell $key->write() to write a public key, rather than requiring undefining the private key. Thanks -Craig
This is caused by using Convert::PEM version 0.06 or earlier. Unfortunately, with Convert::PEM not having a dependency in Makefile.PL it's hard to force a new version.