line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Keyczar::Signer; |
2
|
5
|
|
|
5
|
|
27654
|
use base 'Crypt::Keyczar::Verifier'; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
2363
|
|
3
|
5
|
|
|
5
|
|
27
|
use strict; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
127
|
|
4
|
5
|
|
|
5
|
|
26
|
use warnings; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
115
|
|
5
|
5
|
|
|
5
|
|
23
|
use Carp; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
1135
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub sign { |
9
|
20
|
|
|
20
|
0
|
5615
|
my $self = shift; |
10
|
20
|
|
|
|
|
40
|
my ($data, $expiration_time, $hidden) = @_; |
11
|
20
|
|
|
|
|
29
|
my $result = ''; |
12
|
|
|
|
|
|
|
|
13
|
20
|
|
|
|
|
70
|
my $key = $self->get_key($self->primary); |
14
|
20
|
50
|
|
|
|
62
|
if (!$key) { |
15
|
0
|
|
|
|
|
0
|
croak "no primary key"; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
20
|
|
|
|
|
112
|
$result .= $key->get_header(); |
19
|
20
|
|
|
|
|
70
|
my $engine = $key->get_engine; |
20
|
20
|
100
|
66
|
|
|
218
|
if (defined $expiration_time && $expiration_time > 0) { |
21
|
12
|
|
|
|
|
44
|
my $expiration = pack 'N1', $expiration_time; |
22
|
12
|
|
|
|
|
39
|
$engine->update($expiration); |
23
|
12
|
|
|
|
|
22
|
$result .= $expiration; |
24
|
|
|
|
|
|
|
} |
25
|
20
|
50
|
33
|
|
|
64
|
if (defined $hidden && length $hidden > 0) { |
26
|
0
|
|
|
|
|
0
|
$engine->update($hidden); |
27
|
|
|
|
|
|
|
} |
28
|
20
|
|
|
|
|
80
|
$engine->update($data); |
29
|
20
|
|
|
|
|
50
|
$engine->update(Crypt::Keyczar::FORMAT_BYTES()); |
30
|
20
|
|
|
|
|
10291
|
$result .= $engine->sign(); |
31
|
|
|
|
|
|
|
|
32
|
20
|
|
|
|
|
202
|
return $result; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
__END__ |