line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Keyczar::Signer; |
2
|
5
|
|
|
5
|
|
15476
|
use base 'Crypt::Keyczar::Verifier'; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
1370
|
|
3
|
5
|
|
|
5
|
|
26
|
use strict; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
72
|
|
4
|
5
|
|
|
5
|
|
19
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
82
|
|
5
|
5
|
|
|
5
|
|
20
|
use Carp; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
779
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub sign { |
9
|
20
|
|
|
20
|
0
|
4209
|
my $self = shift; |
10
|
20
|
|
|
|
|
52
|
my ($data, $expiration_time, $hidden) = @_; |
11
|
20
|
|
|
|
|
33
|
my $result = ''; |
12
|
|
|
|
|
|
|
|
13
|
20
|
|
|
|
|
61
|
my $key = $self->get_key($self->primary); |
14
|
20
|
50
|
|
|
|
54
|
if (!$key) { |
15
|
0
|
|
|
|
|
0
|
croak "no primary key"; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
20
|
|
|
|
|
85
|
$result .= $key->get_header(); |
19
|
20
|
|
|
|
|
63
|
my $engine = $key->get_engine; |
20
|
20
|
100
|
66
|
|
|
150
|
if (defined $expiration_time && $expiration_time > 0) { |
21
|
12
|
|
|
|
|
32
|
my $expiration = pack 'N1', $expiration_time; |
22
|
12
|
|
|
|
|
41
|
$engine->update($expiration); |
23
|
12
|
|
|
|
|
22
|
$result .= $expiration; |
24
|
|
|
|
|
|
|
} |
25
|
20
|
50
|
33
|
|
|
54
|
if (defined $hidden && length $hidden > 0) { |
26
|
0
|
|
|
|
|
0
|
$engine->update($hidden); |
27
|
|
|
|
|
|
|
} |
28
|
20
|
|
|
|
|
67
|
$engine->update($data); |
29
|
20
|
|
|
|
|
55
|
$engine->update(Crypt::Keyczar::FORMAT_BYTES()); |
30
|
20
|
|
|
|
|
6717
|
$result .= $engine->sign(); |
31
|
|
|
|
|
|
|
|
32
|
20
|
|
|
|
|
146
|
return $result; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
__END__ |