line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Perl::KeyBase; |
2
|
|
|
|
|
|
|
|
3
|
14
|
|
|
14
|
|
15246
|
use strict; |
|
14
|
|
|
|
|
39
|
|
|
14
|
|
|
|
|
331
|
|
4
|
14
|
|
|
14
|
|
68
|
use warnings; |
|
14
|
|
|
|
|
23
|
|
|
14
|
|
|
|
|
282
|
|
5
|
|
|
|
|
|
|
|
6
|
14
|
|
|
14
|
|
56
|
use Crypt::Perl::X (); |
|
14
|
|
|
|
|
22
|
|
|
14
|
|
|
|
|
2904
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub get_jwk_thumbprint { |
9
|
6
|
|
|
6
|
0
|
2348
|
my ($self, $hash_alg) = @_; |
10
|
|
|
|
|
|
|
|
11
|
6
|
50
|
|
|
|
26
|
die Crypt::Perl::X::create('Generic', 'Need a hashing algorithm!') if !length $hash_alg; |
12
|
|
|
|
|
|
|
|
13
|
6
|
|
|
|
|
547
|
require Digest::SHA; |
14
|
6
|
100
|
66
|
|
|
2358
|
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
|
|
|
|
|
40
|
my $jwk = $self->get_struct_for_public_jwk(); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $json = sprintf( |
21
|
17
|
|
|
|
|
68
|
'{' . join(',', map { qq{"$_":"%s"} } $self->_JWK_THUMBPRINT_JSON_ORDER()) . '}', |
22
|
5
|
|
|
|
|
135
|
@{$jwk}{ $self->_JWK_THUMBPRINT_JSON_ORDER() }, |
|
5
|
|
|
|
|
91
|
|
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
5
|
|
|
|
|
45
|
require MIME::Base64; |
26
|
|
|
|
|
|
|
|
27
|
5
|
|
|
|
|
66
|
return MIME::Base64::encode_base64url( $hash_cr->($json) ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |