[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/vendor/phpseclib/phpseclib/phpseclib/File/ASN1/Maps/ -> RSAPrivateKey.php (source)

   1  <?php
   2  
   3  /**
   4   * RSAPrivateKey
   5   *
   6   * PHP version 5
   7   *
   8   * @author    Jim Wigginton <terrafrost@php.net>
   9   * @copyright 2016 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\File\ASN1\Maps;
  15  
  16  use phpseclib3\File\ASN1;
  17  
  18  /**
  19   * RSAPrivateKey
  20   *
  21   * @author  Jim Wigginton <terrafrost@php.net>
  22   */
  23  abstract class RSAPrivateKey
  24  {
  25      // version must be multi if otherPrimeInfos present
  26      const MAP = [
  27          'type' => ASN1::TYPE_SEQUENCE,
  28          'children' => [
  29              'version' => [
  30                  'type' => ASN1::TYPE_INTEGER,
  31                  'mapping' => ['two-prime', 'multi']
  32              ],
  33              'modulus' => ['type' => ASN1::TYPE_INTEGER],         // n
  34              'publicExponent' => ['type' => ASN1::TYPE_INTEGER],  // e
  35              'privateExponent' => ['type' => ASN1::TYPE_INTEGER], // d
  36              'prime1' => ['type' => ASN1::TYPE_INTEGER],          // p
  37              'prime2' => ['type' => ASN1::TYPE_INTEGER],          // q
  38              'exponent1' => ['type' => ASN1::TYPE_INTEGER],       // d mod (p-1)
  39              'exponent2' => ['type' => ASN1::TYPE_INTEGER],       // d mod (q-1)
  40              'coefficient' => ['type' => ASN1::TYPE_INTEGER],     // (inverse of q) mod p
  41              'otherPrimeInfos' => OtherPrimeInfos::MAP + ['optional' => true]
  42          ]
  43      ];
  44  }