line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::Keyczar::DsaPrivateKey; |
2
|
2
|
|
|
2
|
|
771
|
use base 'Crypt::Keyczar::Key'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
136
|
|
3
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
37
|
|
4
|
2
|
|
|
2
|
|
7
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
52
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
10
|
use Crypt::Keyczar::Util; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
67
|
|
7
|
2
|
|
|
2
|
|
347
|
use Crypt::Keyczar::DsaPublicKey; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
746
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub expose { |
11
|
3
|
|
|
3
|
0
|
7
|
my $self = shift; |
12
|
3
|
|
|
|
|
8
|
my $expose = {}; |
13
|
3
|
|
|
|
|
9
|
$expose->{size} = $self->{size}; |
14
|
3
|
|
|
|
|
10
|
$expose->{publicKey} = $self->get_public->expose; |
15
|
3
|
|
|
|
|
7
|
$expose->{x} = $self->{x}; |
16
|
3
|
|
|
|
|
10
|
return $expose; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub read { |
21
|
26
|
|
|
26
|
0
|
60
|
my $class = shift; |
22
|
26
|
|
|
|
|
38
|
my $json_string = shift; |
23
|
|
|
|
|
|
|
|
24
|
26
|
|
|
|
|
125
|
my $obj = Crypt::Keyczar::Util::decode_json($json_string); |
25
|
26
|
|
|
|
|
65
|
my $self = bless $obj, $class; |
26
|
26
|
|
|
|
|
61
|
$self->{publicKey} = bless $self->{publicKey}, 'Crypt::Keyczar::DsaPublicKey'; |
27
|
26
|
|
|
|
|
83
|
$self->{publicKey}->init(); |
28
|
26
|
|
|
|
|
103
|
$self->init(); |
29
|
26
|
|
|
|
|
80
|
return $self; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub generate { |
34
|
3
|
|
|
3
|
0
|
5
|
my $class = shift; |
35
|
3
|
|
|
|
|
6
|
my $size = shift; |
36
|
|
|
|
|
|
|
|
37
|
3
|
|
|
|
|
171013
|
my $key = Crypt::Keyczar::DsaPrivateKeyEngine->generate($size); |
38
|
3
|
|
|
|
|
32
|
my $priv = {}; |
39
|
3
|
|
|
|
|
14
|
$priv->{size} = $size; |
40
|
3
|
|
|
|
|
27
|
$priv->{x} = Crypt::Keyczar::Util::encode($key->{x}); |
41
|
3
|
|
|
|
|
13
|
my $self = bless $priv, $class; |
42
|
|
|
|
|
|
|
|
43
|
3
|
|
|
|
|
9
|
my $pub = {}; |
44
|
3
|
|
|
|
|
10
|
$pub->{size} = $size; |
45
|
3
|
|
|
|
|
13
|
$pub->{y} = Crypt::Keyczar::Util::encode($key->{y}); |
46
|
3
|
|
|
|
|
12
|
$pub->{p} = Crypt::Keyczar::Util::encode($key->{p}); |
47
|
3
|
|
|
|
|
9
|
$pub->{q} = Crypt::Keyczar::Util::encode($key->{q}); |
48
|
3
|
|
|
|
|
10
|
$pub->{g} = Crypt::Keyczar::Util::encode($key->{g}); |
49
|
3
|
|
|
|
|
25
|
$self->{publicKey} = bless $pub, 'Crypt::Keyczar::DsaPublicKey'; |
50
|
3
|
|
|
|
|
23
|
$self->{publicKey}->init(); |
51
|
3
|
|
|
|
|
24
|
$self->init(); |
52
|
|
|
|
|
|
|
|
53
|
3
|
|
|
|
|
22
|
return $self; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub get_engine { |
58
|
1
|
|
|
1
|
0
|
393
|
my $self = shift; |
59
|
5
|
|
|
|
|
15
|
my @args = map { Crypt::Keyczar::Util::decode($_) } ( |
60
|
|
|
|
|
|
|
$self->{x}, |
61
|
|
|
|
|
|
|
$self->get_public->{y}, |
62
|
|
|
|
|
|
|
$self->get_public->{p}, |
63
|
|
|
|
|
|
|
$self->get_public->{q}, |
64
|
|
|
|
|
|
|
$self->get_public->{g}, |
65
|
1
|
|
|
|
|
4
|
); |
66
|
1
|
|
|
|
|
42
|
return Crypt::Keyczar::DsaPrivateKeyEngine->new(@args); |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
70
|
31
|
|
|
31
|
0
|
74
|
sub hash { return $_[0]->get_public->hash(); } |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
0
|
|
|
0
|
0
|
0
|
sub digest_size { return 48; } |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
40
|
|
|
40
|
0
|
111
|
sub get_public { return $_[0]->{publicKey}; } |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
1; |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
package Crypt::Keyczar::DsaPrivateKeyEngine; |
81
|
2
|
|
|
2
|
|
12
|
use base 'Exporter'; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
97
|
|
82
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
38
|
|
83
|
2
|
|
|
2
|
|
7
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
41
|
|
84
|
2
|
|
|
2
|
|
8
|
use Crypt::Keyczar::Engine; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
33
|
|
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
1; |
88
|
|
|
|
|
|
|
__END__ |