Passed
Push — 2.x-dev ( 346a8b )
by Yuri
01:55
created

src/root.schema.ts

Complexity

Total Complexity 0
Complexity/F 0

Size

Lines of Code 40
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 0
eloc 23
mnd 0
bc 0
fnc 0
dl 0
loc 40
bpm 0
cpm 0
noi 0
c 0
b 0
f 0
ccs 3
cts 3
cp 1
1 1
import { Any, Constructed, Integer, ObjectIdentifier, OctetString, Sequence, Set } from 'asn1js'
2
3 1
import { CONTENT_ID } from './constants'
4
5
/**
6
 * Root schema of an app store receipt
7
 * In order to modify root schema, inspect desired receipt using @see https://lapo.it/asn1js/
8
 */
9 1
export const rootSchema: Sequence = new Sequence({
10
  value: [
11
    new ObjectIdentifier(),
12
    new Constructed({
13
      idBlock: { tagClass: 3, tagNumber: 0 },
14
      value: [
15
        new Sequence({
16
          value: [
17
            new Integer(),
18
            new Set({
19
              value: [
20
                new Sequence({
21
                  value: [new ObjectIdentifier(), new Any()],
22
                }),
23
              ],
24
            }),
25
            new Sequence({
26
              value: [
27
                new ObjectIdentifier(),
28
                new Constructed({
29
                  idBlock: { tagClass: 3, tagNumber: 0 },
30
                  value: [new OctetString({ name: CONTENT_ID })],
31
                }),
32
              ],
33
            }),
34
          ],
35
        }),
36
      ],
37
    }),
38
  ],
39
})
40