Extension.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * Extension
  4. *
  5. * PHP version 5
  6. *
  7. * @category File
  8. * @package ASN1
  9. * @author Jim Wigginton <terrafrost@php.net>
  10. * @copyright 2016 Jim Wigginton
  11. * @license http://www.opensource.org/licenses/mit-license.html MIT License
  12. * @link http://phpseclib.sourceforge.net
  13. */
  14. namespace phpseclib\File\ASN1\Maps;
  15. use phpseclib\File\ASN1;
  16. /**
  17. * Extension
  18. *
  19. * A certificate using system MUST reject the certificate if it encounters
  20. * a critical extension it does not recognize; however, a non-critical
  21. * extension may be ignored if it is not recognized.
  22. *
  23. * http://tools.ietf.org/html/rfc5280#section-4.2
  24. *
  25. * @package ASN1
  26. * @author Jim Wigginton <terrafrost@php.net>
  27. * @access public
  28. */
  29. abstract class Extension
  30. {
  31. const MAP = [
  32. 'type' => ASN1::TYPE_SEQUENCE,
  33. 'children' => [
  34. 'extnId' => ['type' => ASN1::TYPE_OBJECT_IDENTIFIER],
  35. 'critical' => [
  36. 'type' => ASN1::TYPE_BOOLEAN,
  37. 'optional' => true,
  38. 'default' => false
  39. ],
  40. 'extnValue' => ['type' => ASN1::TYPE_OCTET_STRING]
  41. ]
  42. ];
  43. }