line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Perl::KeyBase; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
20286
|
use strict; |
|
15
|
|
|
|
|
34
|
|
|
15
|
|
|
|
|
483
|
|
4
|
15
|
|
|
15
|
|
78
|
use warnings; |
|
15
|
|
|
|
|
44
|
|
|
15
|
|
|
|
|
357
|
|
5
|
|
|
|
|
|
|
|
6
|
15
|
|
|
15
|
|
88
|
use Crypt::Perl::X (); |
|
15
|
|
|
|
|
32
|
|
|
15
|
|
|
|
|
4247
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub get_jwk_thumbprint { |
9
|
6
|
|
|
6
|
0
|
2418
|
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
|
|
|
|
|
615
|
require Digest::SHA; |
14
|
6
|
100
|
66
|
|
|
3408
|
my $hash_cr = ($hash_alg =~ m<\Asha[0-9]+\z>) && Digest::SHA->can($hash_alg) or do { |
15
|
1
|
|
|
|
|
5
|
die Crypt::Perl::X::create('UnknownHash', $hash_alg); |
16
|
|
|
|
|
|
|
}; |
17
|
|
|
|
|
|
|
|
18
|
5
|
|
|
|
|
50
|
my $jwk = $self->get_struct_for_public_jwk(); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
my $json = sprintf( |
21
|
17
|
|
|
|
|
74
|
'{' . join(',', map { qq{"$_":"%s"} } $self->_JWK_THUMBPRINT_JSON_ORDER()) . '}', |
22
|
5
|
|
|
|
|
161
|
@{$jwk}{ $self->_JWK_THUMBPRINT_JSON_ORDER() }, |
|
5
|
|
|
|
|
40
|
|
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
5
|
|
|
|
|
33
|
require MIME::Base64; |
26
|
|
|
|
|
|
|
|
27
|
5
|
|
|
|
|
73
|
return MIME::Base64::encode_base64url( $hash_cr->($json) ); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |