NAME
Palm::KeyRing - Interface to GNU KeyRing databases
SYNOPSIS
use Palm::KeyRing;
# Open the database.
my $db = Palm::KeyRing->new("Keys-Gtkr.pdb");
# Fetch a decoder (verifies the password).
my $decoder = $db->getDecoder("Secret PassPhrase");
die("Incorrect password") unless $decoder;
# Fetch record by number (first = 1).
my $rec = $db->getRecord(1);
# Or fetch record by name.
$rec = $db->getRecordByName("BankAccount");
# Decode record.
my ($name, $account, $password, $note) = $decoder->decode($rec);
DESCRIPTION
Palm::KeyRing provides a (currently read-only) interface to the keyring files as used by the GNU KeyRing tool on Palm handhelds.
Records in the keyring file have 4 fields: name, account, password, and note. All fields except name are encrypted.
METHODS
The following are methods of Palm::KeyRing.
- new
-
Constructor. Takes one argument: the name of the keyring file.
- getRecords
-
Loads all the records from the file in an internal cache (if necessary), and returns the number of records read. Note that the contents will not be decrypted.
- getNames
-
Loads all the records from the file in an internal cache (if neccessary), and returns a list (in scalar context: array reference) of all names used in the keyring file.
- getRecord
-
Takes one integer argument, a record number, and returns the record data. The first data record is numbered 1.
If no such record exists, returns undef.
- getRecordByName
-
Takes one argument, a record name, and returns the corresponding record.
If no such record exists, returns undef.
- getDecoder
-
Takes one argument, the keyring password. If the password is correct, it returns a decoder for this keyring. Otherwise, it returns undef.
The decoder provides one method: decode. This method takes one argument, the record data. It returns a list (in scalar context: array reference) of the record name, account, password and note, all decrypted.
REQUIREMENTS
PDA::Pilot
Crypt::DES
DEMO PROGRAM
Palm::KeyRing comes with a nice GUI based demo program wxkeyring. This program requires WxPerl 0.15 or later.
BUGS
Currently does not handle categories.
AUTHOR
Johan Vromans <jv@cpan.org>.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 90:
You forgot a '=back' before '=head1'