]> Dogcows Code - chaz/p5-File-KDBX/blob - lib/File/KDBX/Key/Password.pm
Version 0.901
[chaz/p5-File-KDBX] / lib / File / KDBX / Key / Password.pm
1 package File::KDBX::Key::Password;
2 # ABSTRACT: A password key
3
4 use warnings;
5 use strict;
6
7 use Crypt::Digest qw(digest_data);
8 use Encode qw(encode);
9 use File::KDBX::Error;
10 use File::KDBX::Util qw(:class erase);
11 use namespace::clean;
12
13 extends 'File::KDBX::Key';
14
15 our $VERSION = '0.901'; # VERSION
16
17 sub init {
18 my $self = shift;
19 my $primitive = shift // throw 'Missing key primitive';
20
21 $self->_set_raw_key(digest_data('SHA256', encode('UTF-8', $primitive)));
22
23 return $self->hide;
24 }
25
26 1;
27
28 __END__
29
30 =pod
31
32 =encoding UTF-8
33
34 =head1 NAME
35
36 File::KDBX::Key::Password - A password key
37
38 =head1 VERSION
39
40 version 0.901
41
42 =head1 SYNOPSIS
43
44 use File::KDBX::Key::Password;
45
46 my $key = File::KDBX::Key::Password->new($password);
47
48 =head1 DESCRIPTION
49
50 A password key is as simple as it sounds. It's just a password or passphrase.
51
52 Inherets methods and attributes from L<File::KDBX::Key>.
53
54 =head1 BUGS
55
56 Please report any bugs or feature requests on the bugtracker website
57 L<https://github.com/chazmcgarvey/File-KDBX/issues>
58
59 When submitting a bug or request, please include a test-file or a
60 patch to an existing test-file that illustrates the bug or desired
61 feature.
62
63 =head1 AUTHOR
64
65 Charles McGarvey <ccm@cpan.org>
66
67 =head1 COPYRIGHT AND LICENSE
68
69 This software is copyright (c) 2022 by Charles McGarvey.
70
71 This is free software; you can redistribute it and/or modify it under
72 the same terms as the Perl 5 programming language system itself.
73
74 =cut
This page took 0.039141 seconds and 4 git commands to generate.