| line | stmt | bran | cond | sub | pod | time | code | 
| 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. | 
| 14 |  |  |  |  |  |  |  | 
| 15 |  |  |  |  |  |  | Note that HTTP requests have some “helper” logic in the subclass | 
| 16 |  |  |  |  |  |  | C. | 
| 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 | 5 |  |  | 5 |  | 1670 | use strict; | 
|  | 5 |  |  |  |  | 6 |  | 
|  | 5 |  |  |  |  | 105 |  | 
| 29 | 5 |  |  | 5 |  | 13 | use warnings; | 
|  | 5 |  |  |  |  | 4 |  | 
|  | 5 |  |  |  |  | 83 |  | 
| 30 |  |  |  |  |  |  |  | 
| 31 | 5 |  |  | 5 |  | 904 | use Net::ACME::Crypt (); | 
|  | 5 |  |  |  |  | 7 |  | 
|  | 5 |  |  |  |  | 66 |  | 
| 32 | 5 |  |  | 5 |  | 936 | use Net::ACME::Utils (); | 
|  | 5 |  |  |  |  | 7 |  | 
|  | 5 |  |  |  |  | 846 |  | 
| 33 |  |  |  |  |  |  |  | 
| 34 |  |  |  |  |  |  | sub new { | 
| 35 | 7 |  |  | 7 | 0 | 9069 | my ( $class, %opts ) = @_; | 
| 36 |  |  |  |  |  |  |  | 
| 37 | 7 |  |  |  |  | 33 | Net::ACME::Utils::verify_token( $opts{'token'} ); | 
| 38 |  |  |  |  |  |  |  | 
| 39 | 7 |  |  |  |  | 23 | return bless { map { ( "_$_" => $opts{$_} ) } qw(type token uri) }, $class; | 
|  | 21 |  |  |  |  | 83 |  | 
| 40 |  |  |  |  |  |  | } | 
| 41 |  |  |  |  |  |  |  | 
| 42 |  |  |  |  |  |  | sub token { | 
| 43 | 7 |  |  | 7 | 0 | 24 | my ($self) = @_; | 
| 44 | 7 |  |  |  |  | 68 | return $self->{'_token'}; | 
| 45 |  |  |  |  |  |  | } | 
| 46 |  |  |  |  |  |  |  | 
| 47 |  |  |  |  |  |  | sub uri { | 
| 48 | 4 |  |  | 4 | 0 | 9 | my ($self) = @_; | 
| 49 | 4 |  |  |  |  | 12 | return $self->{'_uri'}; | 
| 50 |  |  |  |  |  |  | } | 
| 51 |  |  |  |  |  |  |  | 
| 52 |  |  |  |  |  |  | sub type { | 
| 53 | 0 |  |  | 0 | 0 | 0 | my ($self) = @_; | 
| 54 | 0 |  |  |  |  | 0 | return $self->{'_type'}; | 
| 55 |  |  |  |  |  |  | } | 
| 56 |  |  |  |  |  |  |  | 
| 57 |  |  |  |  |  |  | sub make_key_authz { | 
| 58 | 4 |  |  | 4 | 1 | 7 | my ( $self, $pub_jwk_hr ) = @_; | 
| 59 |  |  |  |  |  |  |  | 
| 60 | 4 |  |  |  |  | 9 | my $eval_err = $@; | 
| 61 |  |  |  |  |  |  |  | 
| 62 | 4 |  |  |  |  | 21 | my $jwk_thumbprint = Net::ACME::Crypt::get_jwk_thumbprint( $pub_jwk_hr ); | 
| 63 |  |  |  |  |  |  |  | 
| 64 | 4 |  |  |  |  | 48593 | return "$self->{'_token'}.$jwk_thumbprint"; | 
| 65 |  |  |  |  |  |  | } | 
| 66 |  |  |  |  |  |  |  | 
| 67 |  |  |  |  |  |  | 1; |