]>
Dogcows Code - chaz/p5-File-KDBX/blob - lib/File/KDBX/Key/ChallengeResponse.pm
b17a35cbaf2c9b93fbdae11e8db20e83687beaa6
1 package File
::KDBX
::Key
::ChallengeResponse
;
2 # ABSTRACT: A challenge-response key
10 use parent
'File::KDBX::Key';
12 our $VERSION = '999.999'; # VERSION
16 my $primitive = shift or throw
'Missing key primitive';
18 $self->{responder
} = $primitive;
26 my $challenge = shift // '';
27 # Don't challenge if we already have the response.
28 return $self->SUPER::raw_key
if $challenge eq ($self->{challenge
} // '');
29 $self->_set_raw_key($self->challenge($challenge, @_));
30 $self->{challenge
} = $challenge;
32 $self->SUPER::raw_key
;
37 $response = $key->challenge($challenge, @options);
39 Issue a challenge
and get a response
, or throw
if the responder failed
.
46 my $responder = $self->{responder
} or throw
'Cannot issue challenge without a responder';
47 return $responder->(@_);
55 my $key = File::KDBX::Key::ChallengeResponse->(
56 responder => sub { my $challenge = shift; ...; return $response },
This page took 0.031339 seconds and 3 git commands to generate.