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");
# $rec->{data} contains the raw data.
# $rec->{category} the category index.
# $rec->{name} the name.
# Decode record.
my ($name, $category, $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
-
Returns the number of records read. Note that the contents will not be decrypted.
- getNames
-
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. This is a hash ref with at least keys "name, "data" and "category". Note that "category" is the category index.
If no such record exists, returns undef.
- getRecordByName
-
Takes one argument, a record name, and returns the corresponding record. See getRecord above for the return values.
If no such record exists, returns undef.
- getCategory
-
Takes one argument, a category index. Returns the category as a string.
- getCategories
-
In list context, returns a list of categories. In scalar context returns an array reference.
- 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 (as a hash ref). It returns a list (in scalar context: array reference) of the record name, category_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
Installs Palm::Raw as the default handler for Palm::PDB. This could have side effects if the rest of the program also uses Palm::PDB.
AUTHOR
Johan Vromans <jv@cpan.org>.
LICENCE
Artistic or GPL, whichever you prefer.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 101:
You forgot a '=back' before '=head1'