Issues (15)

src/structures/TimestampResponse.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace vakata\asn1\structures;
4
5
use \vakata\asn1\ASN1;
0 ignored issues
show
The type \vakata\asn1\ASN1 was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
7
class TimestampResponse extends Structure
8
{
9
    public static function map()
10
    {
11
        return [
12
            'tag' => ASN1::TYPE_SEQUENCE,
13
            'children' => [
14
                'status' => [
15
                    'tag' => ASN1::TYPE_SEQUENCE,
16
                    'children' => [
17
                        'status' => [
18
                            'tag' => ASN1::TYPE_INTEGER,
19
                            'map' => [
20
                                'granted',
21
                                'grantedWithMods',
22
                                'rejection',
23
                                'waiting',
24
                                'revocationWarning',
25
                                'revocationNotification'
26
                            ]
27
                        ],
28
                        'statusString' => [
29
                            'tag' => ASN1::TYPE_SEQUENCE,
30
                            'children' => [
31
                                'data' => [
32
                                    'tag' =>ASN1::TYPE_UTF8_STRING
33
                                ]
34
                            ]
35
                        ],
36
                        'failInfo' => [
37
                            'tag' => ASN1::TYPE_BIT_STRING,
38
                            'optional' => true
39
                        ]
40
                    ]
41
                ],
42
                'timeStampToken' => [
43
                    'tag' => ASN1::TYPE_SEQUENCE,
44
                    'optional' => true,
45
                    'children' => [
46
                        'contentType' => ['tag' => ASN1::TYPE_OBJECT_IDENTIFIER ],
47
                        'signedData' => [
48
                            'name' => 0,
49
                            'tag' => ASN1::TYPE_SEQUENCE,
50
                            'children' => [
51
                                'version' => ['tag' => ASN1::TYPE_INTEGER ],
52
                                'algorithms' => [
53
                                    'tag' => ASN1::TYPE_SET,
54
                                    'children' => [
55
                                        'hashAlgorithm' => Common::AlgorithmIdentifier(),
56
                                    ],
57
                                ],
58
                                "tokenInfo" => [
59
                                    'tag' => ASN1::TYPE_SEQUENCE,
60
                                    'optional' => true,
61
                                    'children' => [
62
                                        'contentType' => ['tag' => ASN1::TYPE_OBJECT_IDENTIFIER ],
63
                                        'data' => [
64
                                            'name' => 0,
65
                                            'tag' => ASN1::TYPE_OCTET_STRING,
66
                                            'der' => true,
67
                                            'map' => static::mapToken()
68
                                        ]
69
                                    ]
70
                                ]
71
                            ]
72
                        ]
73
                    ]
74
                ]
75
            ]
76
        ];
77
    }
78
    public static function mapToken()
79
    {
80
        return [
81
            'tag' => ASN1::TYPE_SEQUENCE,
82
            'children' => [
83
                'version' => ['tag' => ASN1::TYPE_INTEGER, 'map' => [1 => 'v1','v2','v3'] ],
84
                'policy' =>  ['tag' => ASN1::TYPE_OBJECT_IDENTIFIER, 'optional' => true ],
85
                'messageImprint' => [
86
                    'tag' => ASN1::TYPE_SEQUENCE,
87
                    'children' => [
88
                       'hashAlgorithm' => Common::AlgorithmIdentifier(),
89
                       'hashedMessage' => [
90
                            'tag' => ASN1::TYPE_OCTET_STRING
91
                            //'optional' => true // non-optional
92
                       ]
93
                    ]
94
                ],
95
                'serialNumber' => ['tag' => ASN1::TYPE_INTEGER, 'base' => 16, 'optional' => true ], // non-optional
96
                'genTime' => ['tag' => ASN1::TYPE_GENERALIZED_TIME], // GeneralizedTime (non-optional]
97
                'accuracy' => [
98
                    'tag' => ASN1::TYPE_SEQUENCE,
99
                    'optional' => true,
100
                    'children' => [
101
                        'seconds' => ['tag' => ASN1::TYPE_INTEGER, 'optional' => true ],
102
                        'millis' => ['tag' => ASN1::TYPE_INTEGER, 'optional' => true, 'name' => 0, 'implicit' => true ],
103
                        'micros' => ['tag' => ASN1::TYPE_INTEGER, 'optional' => true, 'name' => 1, 'implicit' => true ],
104
                    ]
105
                ],
106
                'ordering' => [
107
                    'tag' => ASN1::TYPE_BOOLEAN,
108
                    'optional' => true
109
                ],
110
                'nonce' => [
111
                    'tag' => ASN1::TYPE_INTEGER,
112
                    'optional' => true
113
                ],
114
                'tsa' => ['tag' => ASN1::TYPE_ANY_DER, 'optional' => true, 'name' => 0], // [0] GeneralName
115
                'extensions' => ['tag' => ASN1::TYPE_ANY, 'optional' => true, 'name' => 1] // [0] GeneralName
116
            ]
117
        ];
118
    }
119
}
120