[ Index ] |
PHP Cross Reference of DokuWiki |
[Summary view] [Print] [Text view]
1 <?php 2 3 /** 4 * PKCS Formatted Key Handler 5 * 6 * PHP version 5 7 * 8 * @author Jim Wigginton <terrafrost@php.net> 9 * @copyright 2015 Jim Wigginton 10 * @license http://www.opensource.org/licenses/mit-license.html MIT License 11 * @link http://phpseclib.sourceforge.net 12 */ 13 14 namespace phpseclib3\Crypt\Common\Formats\Keys; 15 16 /** 17 * PKCS1 Formatted Key Handler 18 * 19 * @author Jim Wigginton <terrafrost@php.net> 20 */ 21 abstract class PKCS 22 { 23 /** 24 * Auto-detect the format 25 */ 26 const MODE_ANY = 0; 27 /** 28 * Require base64-encoded PEM's be supplied 29 */ 30 const MODE_PEM = 1; 31 /** 32 * Require raw DER's be supplied 33 */ 34 const MODE_DER = 2; 35 /**#@-*/ 36 37 /** 38 * Is the key a base-64 encoded PEM, DER or should it be auto-detected? 39 * 40 * @var int 41 */ 42 protected static $format = self::MODE_ANY; 43 44 /** 45 * Require base64-encoded PEM's be supplied 46 * 47 */ 48 public static function requirePEM() 49 { 50 self::$format = self::MODE_PEM; 51 } 52 53 /** 54 * Require raw DER's be supplied 55 * 56 */ 57 public static function requireDER() 58 { 59 self::$format = self::MODE_DER; 60 } 61 62 /** 63 * Accept any format and auto detect the format 64 * 65 * This is the default setting 66 * 67 */ 68 public static function requireAny() 69 { 70 self::$format = self::MODE_ANY; 71 } 72 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body