line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Crypt::OpenPGP::Constants; |
2
|
10
|
|
|
10
|
|
393
|
use strict; |
|
10
|
|
|
|
|
15
|
|
|
10
|
|
|
|
|
312
|
|
3
|
|
|
|
|
|
|
|
4
|
10
|
|
|
10
|
|
41
|
use vars qw( %CONSTANTS ); |
|
10
|
|
|
|
|
14
|
|
|
10
|
|
|
|
|
1051
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
%CONSTANTS = ( |
7
|
|
|
|
|
|
|
'PGP_PKT_PUBKEY_ENC' => 1, |
8
|
|
|
|
|
|
|
'PGP_PKT_SIGNATURE' => 2, |
9
|
|
|
|
|
|
|
'PGP_PKT_SYMKEY_ENC' => 3, |
10
|
|
|
|
|
|
|
'PGP_PKT_ONEPASS_SIG' => 4, |
11
|
|
|
|
|
|
|
'PGP_PKT_SECRET_KEY' => 5, |
12
|
|
|
|
|
|
|
'PGP_PKT_PUBLIC_KEY' => 6, |
13
|
|
|
|
|
|
|
'PGP_PKT_SECRET_SUBKEY' => 7, |
14
|
|
|
|
|
|
|
'PGP_PKT_COMPRESSED' => 8, |
15
|
|
|
|
|
|
|
'PGP_PKT_ENCRYPTED' => 9, |
16
|
|
|
|
|
|
|
'PGP_PKT_MARKER' => 10, |
17
|
|
|
|
|
|
|
'PGP_PKT_PLAINTEXT' => 11, |
18
|
|
|
|
|
|
|
'PGP_PKT_RING_TRUST' => 12, |
19
|
|
|
|
|
|
|
'PGP_PKT_USER_ID' => 13, |
20
|
|
|
|
|
|
|
'PGP_PKT_PUBLIC_SUBKEY' => 14, |
21
|
|
|
|
|
|
|
'PGP_PKT_ENCRYPTED_MDC' => 18, |
22
|
|
|
|
|
|
|
'PGP_PKT_MDC' => 19, |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
'DEFAULT_CIPHER' => 2, |
25
|
|
|
|
|
|
|
'DEFAULT_DIGEST' => 2, |
26
|
|
|
|
|
|
|
'DEFAULT_COMPRESS' => 1, |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
10
|
|
|
10
|
|
46
|
use vars qw( %TAGS ); |
|
10
|
|
|
|
|
24
|
|
|
10
|
|
|
|
|
1628
|
|
30
|
|
|
|
|
|
|
my %RULES = ( |
31
|
|
|
|
|
|
|
'^PGP_PKT' => 'packet', |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
for my $re (keys %RULES) { |
35
|
|
|
|
|
|
|
$TAGS{ $RULES{$re} } = [ grep /$re/, keys %CONSTANTS ]; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub import { |
39
|
55
|
|
|
55
|
|
119
|
my $class = shift; |
40
|
|
|
|
|
|
|
|
41
|
55
|
|
|
|
|
112
|
my @to_export; |
42
|
55
|
|
|
|
|
129
|
my @args = @_; |
43
|
55
|
|
|
|
|
119
|
for my $item (@args) { |
44
|
|
|
|
|
|
|
push @to_export, |
45
|
108
|
100
|
|
|
|
400
|
$item =~ s/^:// ? @{ $TAGS{$item} } : $item; |
|
9
|
|
|
|
|
100
|
|
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
10
|
|
|
10
|
|
51
|
no strict 'refs'; |
|
10
|
|
|
|
|
16
|
|
|
10
|
|
|
|
|
1493
|
|
49
|
55
|
|
|
|
|
143
|
my $pkg = caller; |
50
|
55
|
|
|
|
|
378
|
for my $con (@to_export) { |
51
|
|
|
|
|
|
|
warn __PACKAGE__, " does not export the constant '$con'" |
52
|
243
|
50
|
|
|
|
513
|
unless exists $CONSTANTS{$con}; |
53
|
243
|
|
|
430
|
|
8843
|
*{"${pkg}::$con"} = sub () { $CONSTANTS{$con} } |
|
430
|
|
|
|
|
4621
|
|
54
|
243
|
|
|
|
|
700
|
} |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
1; |
58
|
|
|
|
|
|
|
__END__ |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 NAME |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Crypt::OpenPGP::Constants - Exportable constants |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 DESCRIPTION |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
I<Crypt::OpenPGP::Constants> provides a list of common and useful |
67
|
|
|
|
|
|
|
constants for use in I<Crypt::OpenPGP>. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 USAGE |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
None of the constants are exported by default; you have to ask for |
72
|
|
|
|
|
|
|
them explicitly. Some of the constants are grouped into bundles that |
73
|
|
|
|
|
|
|
you can grab all at once; alternatively you can just take the |
74
|
|
|
|
|
|
|
individual constants, one by one. |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
If you wish to import a group, your I<use> statement should look |
77
|
|
|
|
|
|
|
something like this: |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
use Crypt::OpenPGP::Constants qw( :group ); |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Here are the groups: |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=over 4 |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=item * packet |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
All of the I<PGP_PKT_*> constants. These are constants that define |
88
|
|
|
|
|
|
|
packet types. |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=back |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
Other exportable constants, not belonging to a group, are: |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=over 4 |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=item * DEFAULT_CIPHER |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=item * DEFAULT_DIGEST |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=item * DEFAULT_COMPRESS |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
Default cipher, digest, and compression algorithms, to be used if no |
103
|
|
|
|
|
|
|
specific cipher, digest, or compression algorithm is otherwise |
104
|
|
|
|
|
|
|
specified. |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=back |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 AUTHOR & COPYRIGHTS |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
Please see the Crypt::OpenPGP manpage for author, copyright, and |
111
|
|
|
|
|
|
|
license information. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=cut |