| 1 | package File::KDBX::Key::Password; | ||||||||||||||||||||
| 2 | # ABSTRACT: A password key | ||||||||||||||||||||
| 3 | |||||||||||||||||||||
| 4 | 7 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 7 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 7 | ▶ | use Crypt::Digest qw(digest_data); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | 7 | ▶ | use Encode qw(encode); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 9 | 7 | ▶ | use File::KDBX::Error; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 10 | 7 | ▶ | use File::KDBX::Util qw(:class erase); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 11 | 7 | ▶ | use namespace::clean; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 12 | |||||||||||||||||||||
| 13 | 7 | extends 'File::KDBX::Key'; | |||||||||||||||||||
| 14 | |||||||||||||||||||||
| 15 | 7 | our $VERSION = '0.905'; # VERSION | |||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | sub init { | ||||||||||||||||||||
| 18 | 47 | ▶ | my $self = shift; | ||||||||||||||||||
|
Subroutine
init: called CC=2 SCAR=7.4
Pod
documented
| |||||||||||||||||||||
| 19 | 47 | ▶ | my $primitive = shift // throw 'Missing key primitive'; | ||||||||||||||||||
|
Condition33%1/3
shift() // throw("Missing key primitive")
MC/DC0%0/2
shift() // throw("Missing key primitive")
shift()
throw("Missing key primitive")
Truth table33%1/3
A // B
A= shift()B= throw("Missing key primitive")
| |||||||||||||||||||||
| 20 | |||||||||||||||||||||
| 21 | 47 | $self->_set_raw_key(digest_data('SHA256', encode('UTF-8', $primitive))); | |||||||||||||||||||
| 22 | |||||||||||||||||||||
| 23 | 47 | return $self->hide; | |||||||||||||||||||
| 24 | } | ||||||||||||||||||||
| 25 | |||||||||||||||||||||
| 26 | 7 | 1; | |||||||||||||||||||
| 27 | |||||||||||||||||||||
| 28 | __END__ | ||||||||||||||||||||