File-KeePass-KDBX
view release on metacpan or search on metacpan
lib/File/KeePass/KDBX.pm view on Meta::CPAN
See L<File::KeePass/delete_entry>.
=head2 finder_tests
@tests = $k->finder_tests(\%query);
This is the query engine used to find groups and entries.
See L<File::KeePass/finder_tests>.
=head2 now
$string = $k->now;
Get a timestamp representing the current date and time.
=head2 is_locked
$bool = $k->is_locked;
Get whether or not a database is locked (i.e. memory-protected passwords).
See L<File::KeePass/is_locked>.
=head2 lock
$k->lock;
Lock a database.
See L<File::KeePass/lock>.
=head2 unlock
$k->unlock;
Unlock a database.
See L<File::KeePass/unlock>.
=head2 locked_entry_password
$password = $k->locked_entry_password($entry);
Get a memory-protected password.
See L<File::KeePass/locked_entry_password>.
=for Pod::Coverage STORABLE_freeze STORABLE_thaw decode_base64 encode_base64 gen_uuid now uuid
=head1 CAVEATS
This shim uses L<perltie> magics. Some data structures look and act like regular hashes and arrays (mostly),
but you might notice some unexpected magical things happen, like hash fields that populate themselves. The
magic is only there to make matching the B<File::KeePass> interface possible, since that interface assumes
some amount of interaction with unblessed data structures. Some effort was made to at least hide the magic
where reasonable; any magical behavior is incidental and not considered a feature.
You should expect some considerable overhead which makes this module generally slower than using either
B<File::KeePass> or B<File::KDBX> directly. In some cases this might be due to an inefficient implementation
in the shim, but largely it is the cost of transparent compatibility.
If performance is critical and you still don't want to rewrite your code to use B<File::KDBX> directly but do
want to take advantage of some of the new stuff, there is also the option to go part way. The strategy here is
to use B<File::KeePass::KDBX> to load a database and then immediately convert it to a B<File::KeePass> object.
Use that object without any runtime overhead, and then if and when you're ready to save the database or use
any other B<File::KDBX> feature, "upgrade" it back into a B<File::KeePass::KDBX> object. This strategy would
require modest code modifications to your application, to change:
my $k = File::KeePass->new('database.kdbx', 'masterpw');
to this:
my $k = File::KeePass::KDBX->load_db('database.kdbx', 'masterpw')->to_fkp;
# $k is a normal File::KeePass
and change:
$k->save_db('database.kdbx', 'masterpw');
to this:
File::KeePass::KDBX->from_fkp($k)->save_db('database.kdbx', 'masterpw');
This works because B<File::KeePass::KDBX> provides methods L</to_fkp> and L</from_fkp> for converting to and
from B<File::KeePass>. L</new> also works instead of L</from_fkp>.
=head2 Discrepancies
This shim I<is> supposed to be a drop-in replacement for L<File::KeePass>. If you're sticking to the
B<File::KeePass> public interface you probably won't have to rewrite any code. If you do, it could be
considered a B<File::KeePass::KDBX> bug. But there are some differences that some code might notice and could
even get tripped up on:
B<File::KeePass::KDBX> does not provide any of the L<File::KeePass/"UTILITY METHODS"> or
L<File::KeePass/"OTHER METHODS"> unless incidentally, with two exceptions: L</now> and L</default_exp>.
I judge these other methods to not be useful for I<users> of B<File::KeePass> and so probably aren't used by
anyone, but if I'm wrong you can get them by using B<File::KeePass>:
use File::KeePass; # must use before File::KeePass::KDBX
use File::KeePass::KDBX;
Using both B<File::KeePass> and B<File::KeePass::KDBX> in this order will make the latter a proper subclass of
the former, so all the utility methods will be available via inheritance. You might also need to do this if
the answer to C<< File::KeePass::KDBX->new->isa('File::KeePass') >> is important to your code.
B<File::KeePass::KDBX> does not take any pains to replicate
L<File::KeePass bugs|https://rt.cpan.org/Public/Dist/Display.html?Name=File-KeePass>. If your code has any
workarounds, you might need or want to undo those. The issues known to be fixed (or not applicable) by using
B<File::KeePass::KDBX> are:
L<#85012|https://rt.cpan.org/Ticket/Display.html?id=85012>,
L<#82582|https://rt.cpan.org/Ticket/Display.html?id=82582>,
L<#124531|https://rt.cpan.org/Ticket/Display.html?id=124531>,
L<#123330|https://rt.cpan.org/Ticket/Display.html?id=123330>,
L<#120224|https://rt.cpan.org/Ticket/Display.html?id=120224>,
L<#117836|https://rt.cpan.org/Ticket/Display.html?id=117836>,
L<#97055|https://rt.cpan.org/Ticket/Display.html?id=97055>,
L<#96049|https://rt.cpan.org/Ticket/Display.html?id=96049>,
L<#94753|https://rt.cpan.org/Ticket/Display.html?id=94753> and
L<#87109|https://rt.cpan.org/Ticket/Display.html?id=87109>.
( run in 1.767 second using v1.01-cache-2.11-cpan-75ffa21a3d4 )