line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Perl::KeyBase; |
2
|
|
|
|
|
|
|
|
3
|
14
|
|
|
14
|
|
15904
|
use strict; |
|
14
|
|
|
|
|
46
|
|
|
14
|
|
|
|
|
343
|
|
4
|
14
|
|
|
14
|
|
65
|
use warnings; |
|
14
|
|
|
|
|
25
|
|
|
14
|
|
|
|
|
299
|
|
5
|
|
|
|
|
|
|
|
6
|
14
|
|
|
14
|
|
74
|
use Crypt::Perl::X (); |
|
14
|
|
|
|
|
26
|
|
|
14
|
|
|
|
|
3047
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub get_jwk_thumbprint { |
9
|
6
|
|
|
6
|
0
|
2500
|
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
|
|
|
|
|
551
|
require Digest::SHA; |
14
|
6
|
100
|
66
|
|
|
2784
|
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
|
|
|
|
|
44
|
my $jwk = $self->get_struct_for_public_jwk(); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $json = sprintf( |
21
|
17
|
|
|
|
|
75
|
'{' . join(',', map { qq{"$_":"%s"} } $self->_JWK_THUMBPRINT_JSON_ORDER()) . '}', |
22
|
5
|
|
|
|
|
145
|
@{$jwk}{ $self->_JWK_THUMBPRINT_JSON_ORDER() }, |
|
5
|
|
|
|
|
108
|
|
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
5
|
|
|
|
|
37
|
require MIME::Base64; |
26
|
|
|
|
|
|
|
|
27
|
5
|
|
|
|
|
78
|
return MIME::Base64::encode_base64url( $hash_cr->($json) ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |