Subversion Repositories oidplus

Rev

Rev 846 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. <?php
  2.  
  3. /**
  4.  * SpecifiedECDomain
  5.  *
  6.  * From: http://www.secg.org/sec1-v2.pdf#page=109
  7.  *
  8.  * PHP version 5
  9.  *
  10.  * @category  File
  11.  * @package   ASN1
  12.  * @author    Jim Wigginton <terrafrost@php.net>
  13.  * @copyright 2016 Jim Wigginton
  14.  * @license   http://www.opensource.org/licenses/mit-license.html  MIT License
  15.  * @link      http://phpseclib.sourceforge.net
  16.  */
  17.  
  18. namespace phpseclib3\File\ASN1\Maps;
  19.  
  20. use phpseclib3\File\ASN1;
  21.  
  22. /**
  23.  * SpecifiedECDomain
  24.  *
  25.  * @package ASN1
  26.  * @author  Jim Wigginton <terrafrost@php.net>
  27.  * @access  public
  28.  */
  29. abstract class SpecifiedECDomain
  30. {
  31.     const MAP = [
  32.         'type' => ASN1::TYPE_SEQUENCE,
  33.         'children' => [
  34.             'version' => [
  35.                 'type' => ASN1::TYPE_INTEGER,
  36.                 'mapping' => [1 => 'ecdpVer1', 'ecdpVer2', 'ecdpVer3']
  37.             ],
  38.             'fieldID' => FieldID::MAP,
  39.             'curve' => Curve::MAP,
  40.             'base' => ECPoint::MAP,
  41.             'order' => ['type' => ASN1::TYPE_INTEGER],
  42.             'cofactor' => [
  43.                 'type' => ASN1::TYPE_INTEGER,
  44.                 'optional' => true
  45.             ],
  46.             'hash' => ['optional' => true] + HashAlgorithm::MAP
  47.         ]
  48.     ];
  49. }
  50.