line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Perl::KeyBase; |
2
|
|
|
|
|
|
|
|
3
|
14
|
|
|
14
|
|
16285
|
use strict; |
|
14
|
|
|
|
|
36
|
|
|
14
|
|
|
|
|
323
|
|
4
|
14
|
|
|
14
|
|
56
|
use warnings; |
|
14
|
|
|
|
|
24
|
|
|
14
|
|
|
|
|
285
|
|
5
|
|
|
|
|
|
|
|
6
|
14
|
|
|
14
|
|
56
|
use Crypt::Perl::X (); |
|
14
|
|
|
|
|
21
|
|
|
14
|
|
|
|
|
2809
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub get_jwk_thumbprint { |
9
|
6
|
|
|
6
|
0
|
2585
|
my ($self, $hash_alg) = @_; |
10
|
|
|
|
|
|
|
|
11
|
6
|
50
|
|
|
|
25
|
die Crypt::Perl::X::create('Generic', 'Need a hashing algorithm!') if !length $hash_alg; |
12
|
|
|
|
|
|
|
|
13
|
6
|
|
|
|
|
587
|
require Digest::SHA; |
14
|
6
|
100
|
66
|
|
|
2429
|
my $hash_cr = ($hash_alg =~ m<\Asha[0-9]+\z>) && Digest::SHA->can($hash_alg) or do { |
15
|
1
|
|
|
|
|
6
|
die Crypt::Perl::X::create('UnknownHash', $hash_alg); |
16
|
|
|
|
|
|
|
}; |
17
|
|
|
|
|
|
|
|
18
|
5
|
|
|
|
|
45
|
my $jwk = $self->get_struct_for_public_jwk(); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $json = sprintf( |
21
|
17
|
|
|
|
|
62
|
'{' . join(',', map { qq{"$_":"%s"} } $self->_JWK_THUMBPRINT_JSON_ORDER()) . '}', |
22
|
5
|
|
|
|
|
136
|
@{$jwk}{ $self->_JWK_THUMBPRINT_JSON_ORDER() }, |
|
5
|
|
|
|
|
90
|
|
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
5
|
|
|
|
|
31
|
require MIME::Base64; |
26
|
|
|
|
|
|
|
|
27
|
5
|
|
|
|
|
64
|
return MIME::Base64::encode_base64url( $hash_cr->($json) ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |