1<?php
2
3/**
4 * OneAsymmetricKey
5 *
6 * See https://tools.ietf.org/html/rfc5958
7 *
8 * PHP version 5
9 *
10 * @author    Jim Wigginton <terrafrost@php.net>
11 * @copyright 2016 Jim Wigginton
12 * @license   http://www.opensource.org/licenses/mit-license.html  MIT License
13 * @link      http://phpseclib.sourceforge.net
14 */
15
16namespace phpseclib3\File\ASN1\Maps;
17
18use phpseclib3\File\ASN1;
19
20/**
21 * OneAsymmetricKey
22 *
23 * @author  Jim Wigginton <terrafrost@php.net>
24 */
25abstract class OneAsymmetricKey
26{
27    const MAP = [
28        'type' => ASN1::TYPE_SEQUENCE,
29        'children' => [
30            'version' => [
31                'type' => ASN1::TYPE_INTEGER,
32                'mapping' => ['v1', 'v2']
33            ],
34            'privateKeyAlgorithm' => AlgorithmIdentifier::MAP,
35            'privateKey' => PrivateKey::MAP,
36            'attributes' => [
37                'constant' => 0,
38                'optional' => true,
39                'implicit' => true
40            ] + Attributes::MAP,
41            'publicKey' => [
42                'constant' => 1,
43                'optional' => true,
44                'implicit' => true
45            ] + PublicKey::MAP
46        ]
47    ];
48}
49