Rev 846 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 846 | Rev 874 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | /** |
3 | /** |
4 | * PKCS Formatted Key Handler |
4 | * PKCS Formatted Key Handler |
5 | * |
5 | * |
6 | * PHP version 5 |
6 | * PHP version 5 |
7 | * |
7 | * |
- | 8 | * @category Crypt |
|
- | 9 | * @package Common |
|
8 | * @author Jim Wigginton <terrafrost@php.net> |
10 | * @author Jim Wigginton <terrafrost@php.net> |
9 | * @copyright 2015 Jim Wigginton |
11 | * @copyright 2015 Jim Wigginton |
10 | * @license http://www.opensource.org/licenses/mit-license.html MIT License |
12 | * @license http://www.opensource.org/licenses/mit-license.html MIT License |
11 | * @link http://phpseclib.sourceforge.net |
13 | * @link http://phpseclib.sourceforge.net |
12 | */ |
14 | */ |
Line 14... | Line 16... | ||
14 | namespace phpseclib3\Crypt\Common\Formats\Keys; |
16 | namespace phpseclib3\Crypt\Common\Formats\Keys; |
15 | 17 | ||
16 | /** |
18 | /** |
17 | * PKCS1 Formatted Key Handler |
19 | * PKCS1 Formatted Key Handler |
18 | * |
20 | * |
- | 21 | * @package RSA |
|
19 | * @author Jim Wigginton <terrafrost@php.net> |
22 | * @author Jim Wigginton <terrafrost@php.net> |
- | 23 | * @access public |
|
20 | */ |
24 | */ |
21 | abstract class PKCS |
25 | abstract class PKCS |
22 | { |
26 | { |
23 | /** |
27 | /** |
24 | * Auto-detect the format |
28 | * Auto-detect the format |
Line 35... | Line 39... | ||
35 | /**#@-*/ |
39 | /**#@-*/ |
36 | 40 | ||
37 | /** |
41 | /** |
38 | * Is the key a base-64 encoded PEM, DER or should it be auto-detected? |
42 | * Is the key a base-64 encoded PEM, DER or should it be auto-detected? |
39 | * |
43 | * |
- | 44 | * @access private |
|
40 | * @var int |
45 | * @var int |
41 | */ |
46 | */ |
42 | protected static $format = self::MODE_ANY; |
47 | protected static $format = self::MODE_ANY; |
43 | 48 | ||
44 | /** |
49 | /** |
45 | * Require base64-encoded PEM's be supplied |
50 | * Require base64-encoded PEM's be supplied |
46 | * |
51 | * |
- | 52 | * @access public |
|
47 | */ |
53 | */ |
48 | public static function requirePEM() |
54 | public static function requirePEM() |
49 | { |
55 | { |
50 | self::$format = self::MODE_PEM; |
56 | self::$format = self::MODE_PEM; |
51 | } |
57 | } |
52 | 58 | ||
53 | /** |
59 | /** |
54 | * Require raw DER's be supplied |
60 | * Require raw DER's be supplied |
55 | * |
61 | * |
- | 62 | * @access public |
|
56 | */ |
63 | */ |
57 | public static function requireDER() |
64 | public static function requireDER() |
58 | { |
65 | { |
59 | self::$format = self::MODE_DER; |
66 | self::$format = self::MODE_DER; |
60 | } |
67 | } |
Line 62... | Line 69... | ||
62 | /** |
69 | /** |
63 | * Accept any format and auto detect the format |
70 | * Accept any format and auto detect the format |
64 | * |
71 | * |
65 | * This is the default setting |
72 | * This is the default setting |
66 | * |
73 | * |
- | 74 | * @access public |
|
67 | */ |
75 | */ |
68 | public static function requireAny() |
76 | public static function requireAny() |
69 | { |
77 | { |
70 | self::$format = self::MODE_ANY; |
78 | self::$format = self::MODE_ANY; |
71 | } |
79 | } |