| 1 | package Net::ACME2::JWTMaker::RSA; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 1 | ▶ | use parent qw( Net::ACME2::JWTMaker ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 1 | ▶ | use constant _ALG => 'RS256'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 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 | ▶ | my ( $self ) = @_; |
|
Subroutine
_get_signer: called CC=1 SCAR=0.0
| |||
| 16 | |||
| 17 | return sub { | ||
| 18 | 2 | ▶ | return $self->{'key'}->can('sign_' . _ALG())->($self->{'key'}, @_); |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 19 | 2 | }; | |
| 20 | } | ||
| 21 | |||
| 22 | 1 | 1; | |