[BACK]Return to example2.pl CVS log [TXT][DIR] Up to [local] / palm / Palm-Keyring / examples

File: [local] / palm / Palm-Keyring / examples / example2.pl (download)

Revision 1.2, Tue Jan 30 04:59:55 2007 UTC (17 years, 5 months ago) by andrew
Branch: MAIN
Changes since 1.1: +14 -9 lines

Switch to decrypting one record at a time when requested.  That leads to more tests so that's kewl :-)

#!/usr/bin/perl
# $RedRiver$
use strict;
use warnings;

use Palm::PDB;
use Palm::Keyring;

my $pdb = new Palm::PDB;

$pdb->Load("Keys-Gtkr-example.PDB"); 
$pdb->Password('12345');

foreach (0..$#{ $pdb->{'records'} }) {
    next if $_ == 0;
    my $rec = $pdb->{'records'}->[$_];
    my $acct = $pdb->Decrypt($rec);

    print join ":", $rec->{'data'} , $acct->{'account'},
        $acct->{'password'}, $acct->{'notes'};
    print "\n";
}