X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fp5-File-KDBX;a=blobdiff_plain;f=lib%2FFile%2FKDBX%2FKey%2FFile.pm;h=fdf131a0993a2fb6fc86c7cff1495ab9561dc596;hp=5949d4c8afa2ea3147de65bd3a869cd1fbfd909e;hb=37b09e0f2832514b33de4499a83f22d5ffe7c0a3;hpb=8a37f035ef35682b764c34e7b3c61ce03318b1c7 diff --git a/lib/File/KDBX/Key/File.pm b/lib/File/KDBX/Key/File.pm index 5949d4c..fdf131a 100644 --- a/lib/File/KDBX/Key/File.pm +++ b/lib/File/KDBX/Key/File.pm @@ -9,16 +9,46 @@ use Crypt::Misc 0.029 qw(decode_b64 encode_b64); use Crypt::PRNG qw(random_bytes); use File::KDBX::Constants qw(:key_file); use File::KDBX::Error; -use File::KDBX::Util qw(:erase trim); +use File::KDBX::Util qw(:class :erase trim); use Ref::Util qw(is_ref is_scalarref); use Scalar::Util qw(openhandle); use XML::LibXML::Reader; use namespace::clean; -use parent 'File::KDBX::Key'; +extends 'File::KDBX::Key'; our $VERSION = '999.999'; # VERSION +=attr type + + $type = $key->type; + +Get the type of key file. Can be one of: + +=for :list +* C +* C +* C +* C + +=attr version + + $version = $key->version; + +Get the file version. Only applies to XML key files. + +=attr filepath + + $filepath = $key->filepath; + +Get the filepath to the key file, if known. + +=cut + +has 'type', is => 'ro'; +has 'version', is => 'ro'; +has 'filepath', is => 'ro'; + =method load $key = $key->load($filepath); @@ -97,42 +127,6 @@ sub reload { return $self; } -=attr type - - $type = $key->type; - -Get the type of key file. Can be one of: - -=for :list -* C -* C -* C -* C - -=cut - -sub type { $_[0]->{type} } - -=attr version - - $version = $key->version; - -Get the file version. Only applies to XML key files. - -=cut - -sub version { $_[0]->{version} } - -=attr filepath - - $filepath = $key->filepath; - -Get the filepath to the key file, if known. - -=cut - -sub filepath { $_[0]->{filepath} } - =method save $key->save;