line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Perl::KeyBase; |
2
|
|
|
|
|
|
|
|
3
|
13
|
|
|
13
|
|
14036
|
use strict; |
|
13
|
|
|
|
|
42
|
|
|
13
|
|
|
|
|
304
|
|
4
|
13
|
|
|
13
|
|
54
|
use warnings; |
|
13
|
|
|
|
|
18
|
|
|
13
|
|
|
|
|
239
|
|
5
|
|
|
|
|
|
|
|
6
|
13
|
|
|
13
|
|
317
|
use Crypt::Perl::X (); |
|
13
|
|
|
|
|
25
|
|
|
13
|
|
|
|
|
2621
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub get_jwk_thumbprint { |
9
|
6
|
|
|
6
|
0
|
1662
|
my ($self, $hash_alg) = @_; |
10
|
|
|
|
|
|
|
|
11
|
6
|
50
|
|
|
|
30
|
die Crypt::Perl::X::create('Generic', 'Need a hashing algorithm!') if !length $hash_alg; |
12
|
|
|
|
|
|
|
|
13
|
6
|
|
|
|
|
508
|
require Digest::SHA; |
14
|
6
|
100
|
66
|
|
|
2370
|
my $hash_cr = ($hash_alg =~ m<\Asha[0-9]+\z>) && Digest::SHA->can($hash_alg) or do { |
15
|
1
|
|
|
|
|
7
|
die Crypt::Perl::X::create('UnknownHash', $hash_alg); |
16
|
|
|
|
|
|
|
}; |
17
|
|
|
|
|
|
|
|
18
|
5
|
|
|
|
|
38
|
my $jwk = $self->get_struct_for_public_jwk(); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $json = sprintf( |
21
|
17
|
|
|
|
|
109
|
'{' . join(',', map { qq{"$_":"%s"} } $self->_JWK_THUMBPRINT_JSON_ORDER()) . '}', |
22
|
5
|
|
|
|
|
138
|
@{$jwk}{ $self->_JWK_THUMBPRINT_JSON_ORDER() }, |
|
5
|
|
|
|
|
122
|
|
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
5
|
|
|
|
|
34
|
require MIME::Base64; |
26
|
|
|
|
|
|
|
|
27
|
5
|
|
|
|
|
75
|
return MIME::Base64::encode_base64url( $hash_cr->($json) ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |