| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package MToken::Const; # $Id: Const.pm 72 2019-06-11 07:28:00Z minus $ |
|
2
|
2
|
|
|
2
|
|
13
|
use strict; |
|
|
2
|
|
|
|
|
5
|
|
|
|
2
|
|
|
|
|
61
|
|
|
3
|
2
|
|
|
2
|
|
9
|
use utf8; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
=encoding utf-8 |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 NAME |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
MToken::Const - Interface for MToken Constants |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 VERSION |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Version 1.01 |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
use MToken::Const; |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
This module provide interface for MToken Constants |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head2 PROJECT, PROJECTNAME |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
Returns name of the project |
|
26
|
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 HISTORY |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
See C file |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 TO DO |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
See C file |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 BUGS |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
* none noted |
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 SEE ALSO |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
L |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=head1 AUTHOR |
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
Serż Minus (Sergey Lepenkov) L Eabalama@cpan.orgE |
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 COPYRIGHT |
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Copyright (C) 1998-2019 D&D Corporation. All Rights Reserved |
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 LICENSE |
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or |
|
54
|
|
|
|
|
|
|
modify it under the same terms as Perl itself. |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
See C file and L |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
use constant { |
|
61
|
|
|
|
|
|
|
# GENERAL |
|
62
|
2
|
50
|
|
|
|
593
|
PROJECT => 'mtoken', |
|
|
|
50
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
PROJECTNAME => 'mtoken', |
|
64
|
|
|
|
|
|
|
PREFIX => 'mtoken', |
|
65
|
|
|
|
|
|
|
HOSTNAME => 'localhost', |
|
66
|
|
|
|
|
|
|
DEFAULT_URL => 'http://localhost', |
|
67
|
|
|
|
|
|
|
MSWIN => $^O =~ /mswin/i ? 1 : 0, |
|
68
|
|
|
|
|
|
|
DIR_KEYS => 'keys', |
|
69
|
|
|
|
|
|
|
DIR_CERTS => 'certs', |
|
70
|
|
|
|
|
|
|
DIR_ETC => 'etc', |
|
71
|
|
|
|
|
|
|
DIR_BACKUP => 'backup', |
|
72
|
|
|
|
|
|
|
DIR_RESTORE => 'restore', |
|
73
|
|
|
|
|
|
|
DIR_TMP => $^O =~ /mswin/i ? 'tmp' : '.tmp', |
|
74
|
|
|
|
|
|
|
GLOBAL_CONF_FILE => 'mtoken.conf', |
|
75
|
|
|
|
|
|
|
LOCAL_CONF_FILE => '.mtoken', |
|
76
|
|
|
|
|
|
|
PWCACHE_FILE => '.pwcache', |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
PUBLIC_GPG_KEY => 'public.key', |
|
79
|
|
|
|
|
|
|
PRIVATE_GPG_KEY => 'private.key', |
|
80
|
|
|
|
|
|
|
MY_PUBLIC_KEY => 'mypublic.key', |
|
81
|
|
|
|
|
|
|
MY_PRIVATE_KEY => 'myprivate.key', |
|
82
|
|
|
|
|
|
|
GPGCONFFILE => 'gpg.conf', |
|
83
|
|
|
|
|
|
|
GPGBIN => 'gpg', |
|
84
|
|
|
|
|
|
|
OPENSSLBIN => 'openssl', |
|
85
|
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
# MATH |
|
87
|
|
|
|
|
|
|
TRUE => 1, |
|
88
|
|
|
|
|
|
|
FALSE => 0, |
|
89
|
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
# CRYPT |
|
91
|
|
|
|
|
|
|
KEYSUFFIX => '.key', |
|
92
|
|
|
|
|
|
|
KEYMINSIZE => 32, |
|
93
|
|
|
|
|
|
|
KEYMAXSIZE => 2048, |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
# TEST |
|
96
|
|
|
|
|
|
|
FOO => 1, |
|
97
|
|
|
|
|
|
|
BAR => 2, |
|
98
|
|
|
|
|
|
|
BAZ => 3, |
|
99
|
|
|
|
|
|
|
|
|
100
|
2
|
|
|
2
|
|
283
|
}; |
|
|
2
|
|
|
|
|
4
|
|
|
101
|
|
|
|
|
|
|
|
|
102
|
2
|
|
|
2
|
|
15
|
use base qw/Exporter/; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
217
|
|
|
103
|
|
|
|
|
|
|
|
|
104
|
2
|
|
|
2
|
|
14
|
use vars qw/$VERSION @EXPORT @EXPORT_OK %EXPORT_TAGS/; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
363
|
|
|
105
|
|
|
|
|
|
|
$VERSION = '1.01'; |
|
106
|
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
# Named groups of exports |
|
108
|
|
|
|
|
|
|
%EXPORT_TAGS = ( |
|
109
|
|
|
|
|
|
|
'GENERAL' => [qw/ |
|
110
|
|
|
|
|
|
|
PROJECT PROJECTNAME PREFIX |
|
111
|
|
|
|
|
|
|
HOSTNAME DEFAULT_URL |
|
112
|
|
|
|
|
|
|
DIR_KEYS DIR_CERTS DIR_ETC DIR_BACKUP DIR_RESTORE DIR_TMP |
|
113
|
|
|
|
|
|
|
GLOBAL_CONF_FILE LOCAL_CONF_FILE PWCACHE_FILE |
|
114
|
|
|
|
|
|
|
MY_PUBLIC_KEY MY_PRIVATE_KEY |
|
115
|
|
|
|
|
|
|
GPGCONFFILE PUBLIC_GPG_KEY PRIVATE_GPG_KEY |
|
116
|
|
|
|
|
|
|
MSWIN |
|
117
|
|
|
|
|
|
|
OPENSSLBIN GPGBIN |
|
118
|
|
|
|
|
|
|
/], |
|
119
|
|
|
|
|
|
|
'MATH' => [qw/ |
|
120
|
|
|
|
|
|
|
TRUE FALSE |
|
121
|
|
|
|
|
|
|
/], |
|
122
|
|
|
|
|
|
|
'CRYPT' => [qw/ |
|
123
|
|
|
|
|
|
|
KEYSUFFIX KEYMINSIZE KEYMAXSIZE |
|
124
|
|
|
|
|
|
|
/], |
|
125
|
|
|
|
|
|
|
'TEST' => [qw/ |
|
126
|
|
|
|
|
|
|
FOO |
|
127
|
|
|
|
|
|
|
BAR |
|
128
|
|
|
|
|
|
|
BAZ |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
/], |
|
131
|
|
|
|
|
|
|
); |
|
132
|
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
# Items to export into callers namespace by default |
|
134
|
|
|
|
|
|
|
# (move infrequently used names to @EXPORT_OK below) |
|
135
|
|
|
|
|
|
|
@EXPORT = ( |
|
136
|
|
|
|
|
|
|
@{$EXPORT_TAGS{GENERAL}}, |
|
137
|
|
|
|
|
|
|
); |
|
138
|
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
# Other items we are prepared to export if requested |
|
140
|
|
|
|
|
|
|
@EXPORT_OK = ( |
|
141
|
|
|
|
|
|
|
map {@{$_}} values %EXPORT_TAGS |
|
142
|
|
|
|
|
|
|
); |
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
1; |