ACME/Challenge/Pending.pm

filter: Statementstmt 92.5% 25 / 27 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 88.8% 8 / 9 Podpod 20.0% 1 / 5 totaltotal 82.9% 34 / 41 CC 1 SCAR 1.1
CC
1
Cov
93%
type
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« ACME/X/HashBase.pm ↑ Summary ACME/X/HTTP/Network.pm »
1 package Net::ACME::Challenge::Pending;
2  
3 =encoding utf-8
4  
5 =head1 NAME
6  
7 Net::ACME::Challenge::Pending - base class for an unhandled challenge
8  
9 =head1 DESCRIPTION
10  
11 This base class encapsulates behavior to respond to unhandled challenges.
12 To work with challenges that have been handled (successfully or not),
13 see C<Net::ACME::Challenge>.
14  
15 Note that HTTP requests have some “helper” logic in the subclass
16 C<Net::ACME::Challenge::Pending::http_01>.
17  
18 =head1 METHODS
19  
20 =head2 $OBJ->make_key_authz( JWK_HR )
21  
22 JWK_HR is a hashref representation of the ACME registration key’s public JWK.
23  
24 Returns a string to use as key authorization for the challenge.
25  
26 =cut
27  
28 10 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
29 10 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
30  
31 10 ▶use Net::ACME::Crypt ();
Subroutine BEGIN: called CC=1 SCAR=0.0
32 10 ▶use Net::ACME::Utils ();
Subroutine BEGIN: called CC=1 SCAR=0.0
33  
34 7 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
35 7 my ( $class, %opts ) = @_;
36  
37 7 Net::ACME::Utils::verify_token( $opts{'token'} );
38  
39 7 return bless { map { ( "_$_" => $opts{$_} ) } qw(type token uri) }, $class;
40 }
41  
42 7 ▶sub token {
Subroutine token: called CC=1 SCAR=0.0
Pod undocumented
43 7 my ($self) = @_;
44 7 return $self->{'_token'};
45 }
46  
47 4 ▶sub uri {
Subroutine uri: called CC=1 SCAR=0.0
Pod undocumented
48 4 my ($self) = @_;
49 4 return $self->{'_uri'};
50 }
51  
52 0 ▶sub type {
Subroutine type: not called CC=1 SCAR=6.9
Pod undocumented
53 0 my ($self) = @_;
54 0 return $self->{'_type'};
55 }
56  
57 4 ▶sub make_key_authz {
Subroutine make_key_authz: called CC=1 SCAR=0.0
Pod documented
58 4 my ( $self, $pub_jwk_hr ) = @_;
59  
60 4 my $eval_err = $@;
61  
62 4 my $jwk_thumbprint = Net::ACME::Crypt::get_jwk_thumbprint( $pub_jwk_hr );
63  
64 4 return "$self->{'_token'}.$jwk_thumbprint";
65 }
66  
67 10 1;
« ACME/X/HashBase.pm ↑ Summary ACME/X/HTTP/Network.pm »