File Coverage

blib/lib/Net/ACME2/JWTMaker/RSA.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 21 21 100.0


line stmt bran cond sub pod time code
1             package Net::ACME2::JWTMaker::RSA;
2              
3 1     1   537 use strict;
  1         2  
  1         25  
4 1     1   5 use warnings;
  1         4  
  1         25  
5              
6 1     1   5 use parent qw( Net::ACME2::JWTMaker );
  1         1  
  1         4  
7              
8 1     1   38 use constant _ALG => 'RS256';
  1         5  
  1         104  
9              
10             #Based on Crypt::JWT::encode_jwt(), but focused on this particular
11             #protocol’s needs. Note that UTF-8 might get mangled in here,
12             #but that’s not a problem since ACME shouldn’t require sending raw UTF-8.
13             #(Maybe with registration??)
14             sub _get_signer {
15 2     2   5 my ( $self ) = @_;
16              
17             return sub {
18 2     2   18 return $self->{'key'}->can('sign_' . _ALG())->($self->{'key'}, @_);
19 2         10 };
20             }
21              
22             1;