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

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

Revision 1.3, Tue Jan 30 04:59:55 2007 UTC (17 years, 3 months ago) by andrew
Branch: MAIN
CVS Tags: PALM_KEYRING_0_96_06, HEAD
Changes since 1.2: +12 -5 lines

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

#!/usr/bin/perl
use strict;
use warnings;
use diagnostics;

use lib 'lib';
use Palm::PDB;
use Palm::Keyring;
use YAML;

my $pdb = new Palm::PDB;

$pdb->Load("Keys-Gtkr.pdb") || die "Unable to load PDB"; 

#print Dump $pdb->{'records'};

print "Enter: ";
my $Pass = <>;
chomp $Pass;
print "\n";


foreach my $rec (@{ $pdb->{'records'} }) {
    next unless $rec->{'encrypted'};

	my $acct = $pdb->Decrypt($rec, $Pass) || die "Couldn't decrypt!";
	print Dump $rec, $acct;
}