1 |
|
2 |
|
3 | export class BerReader {
|
4 | readonly buffer: Buffer;
|
5 | readonly offset: number;
|
6 | readonly length: number;
|
7 | readonly remain: number;
|
8 | readonly _buf: Buffer;
|
9 | _size: number;
|
10 | _offset: number;
|
11 |
|
12 | constructor(data: Buffer);
|
13 |
|
14 | peek(): number | null;
|
15 | readBoolean(): boolean | null;
|
16 | readByte(peek: boolean): number | null;
|
17 | readEnumeration(): number | null;
|
18 | readInt(): number | null;
|
19 | readLength(offset?: number): number | null;
|
20 | readOID(tag?: number): string | null;
|
21 | readSequence(tag?: number): number | null;
|
22 | readString(tag?: number): string | null;
|
23 | readString(tag: number, retbuf: boolean): Buffer | null;
|
24 | _readTag(tag?: number): number | null;
|
25 | }
|
26 |
|
27 | export class BerWriter {
|
28 | readonly buffer: Buffer;
|
29 | readonly _buf: Buffer;
|
30 | readonly _size: number;
|
31 | _offset: number;
|
32 |
|
33 | constructor(options?: { size: number; growthFactor: number });
|
34 |
|
35 | endSequence(): void;
|
36 | startSequence(tag?: number): void;
|
37 | writeBoolean(b: boolean, tag?: number): void;
|
38 | writeBuffer(buf: Buffer, tag: number): void;
|
39 | writeByte(b: number): void;
|
40 | writeEnumeration(i: number, tag?: number): void;
|
41 | writeInt(i: number, tag?: number): void;
|
42 | writeLength(len: number): void;
|
43 | writeNull(): void;
|
44 | writeOID(s: string, tag: number): void;
|
45 | writeString(s: string, tag?: number): void;
|
46 | writeStringArray(strings: readonly string[]): void;
|
47 | _ensure(length: number): void;
|
48 | }
|
49 |
|
50 | export namespace Ber {
|
51 | const BMPString: number;
|
52 | const BitString: number;
|
53 | const Boolean: number;
|
54 | const CharacterString: number;
|
55 | const Constructor: number;
|
56 | const Context: number;
|
57 | const EOC: number;
|
58 | const Enumeration: number;
|
59 | const External: number;
|
60 | const GeneralString: number;
|
61 | const GeneralizedTime: number;
|
62 | const GraphicString: number;
|
63 | const IA5String: number;
|
64 | const Integer: number;
|
65 | const Null: number;
|
66 | const NumericString: number;
|
67 | const OID: number;
|
68 | const ObjectDescriptor: number;
|
69 | const OctetString: number;
|
70 | const PDV: number;
|
71 | const PrintableString: number;
|
72 | const Real: number;
|
73 | const RelativeOID: number;
|
74 | const Sequence: number;
|
75 | const Set: number;
|
76 | const T61String: number;
|
77 | const UTCTime: number;
|
78 | const UniversalString: number;
|
79 | const Utf8String: number;
|
80 | const VideotexString: number;
|
81 | const VisibleString: number;
|
82 | }
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 |
|
107 |
|
108 |
|
109 |
|
110 |
|
111 |
|
112 |
|
113 |
|
114 |
|
115 |
|
116 |
|
117 |
|
118 |
|