@syengup/fridaynext-hermes-channel 0.1.0-beta.3 → 0.1.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/install-config.js +84 -0
- package/install-host.py +95 -0
- package/install-runtime.js +167 -35
- package/install.js +23 -6
- package/package.json +6 -5
- package/plugin.bundle +0 -0
- package/validation.json +1 -0
- package/plugin/README.md +0 -21
- package/plugin/__init__.py +0 -3
- package/plugin/fridaynext_plugin/__init__.py +0 -71
- package/plugin/fridaynext_plugin/adapter.py +0 -1124
- package/plugin/fridaynext_plugin/agent_defaults.py +0 -107
- package/plugin/fridaynext_plugin/canonical_control.py +0 -509
- package/plugin/fridaynext_plugin/compat_v0225.py +0 -910
- package/plugin/fridaynext_plugin/control_cli.py +0 -101
- package/plugin/fridaynext_plugin/controls.py +0 -296
- package/plugin/fridaynext_plugin/delivery_context.py +0 -210
- package/plugin/fridaynext_plugin/diagnostics.py +0 -165
- package/plugin/fridaynext_plugin/history.py +0 -421
- package/plugin/fridaynext_plugin/host.py +0 -317
- package/plugin/fridaynext_plugin/initial_settings.py +0 -184
- package/plugin/fridaynext_plugin/inline_media.py +0 -58
- package/plugin/fridaynext_plugin/media_input.py +0 -139
- package/plugin/fridaynext_plugin/media_observations.py +0 -172
- package/plugin/fridaynext_plugin/media_output.py +0 -277
- package/plugin/fridaynext_plugin/message_speech.py +0 -143
- package/plugin/fridaynext_plugin/recovery.py +0 -214
- package/plugin/fridaynext_plugin/runtime_port.py +0 -571
- package/plugin/fridaynext_plugin/sessions.py +0 -184
- package/plugin/fridaynext_plugin/settings.py +0 -695
- package/plugin/fridaynext_plugin/settings_control.py +0 -101
- package/plugin/fridaynext_plugin/state.py +0 -155
- package/plugin/fridaynext_plugin/stream_bridge.py +0 -493
- package/plugin/fridaynext_plugin/stream_media.py +0 -59
- package/plugin/fridaynext_plugin/stream_projection.py +0 -269
- package/plugin/plugin.yaml +0 -18
- package/plugin/runtime/dist/host-peer.js +0 -106
- package/plugin/runtime/dist/hosted-artifacts.js +0 -189
- package/plugin/runtime/dist/hosted-backend.js +0 -211
- package/plugin/runtime/dist/hosted-delivery-observations.js +0 -91
- package/plugin/runtime/dist/hosted-media.js +0 -327
- package/plugin/runtime/dist/hosted-recovery.js +0 -55
- package/plugin/runtime/dist/hosted-settings.js +0 -26
- package/plugin/runtime/dist/hosted-stream.js +0 -104
- package/plugin/runtime/dist/identity.js +0 -55
- package/plugin/runtime/dist/kit-contract.json +0 -1
- package/plugin/runtime/dist/media-transport.js +0 -168
- package/plugin/runtime/dist/oss-upload-worker.js +0 -7
- package/plugin/runtime/dist/oss-upload.js +0 -94
- package/plugin/runtime/dist/ownership.js +0 -21
- package/plugin/runtime/dist/platform-service.js +0 -32
- package/plugin/runtime/dist/plugin-control.js +0 -189
- package/plugin/runtime/dist/plugin-worker.js +0 -43
- package/plugin/runtime/dist/private-files.js +0 -24
- package/plugin/runtime/dist/process-lock.js +0 -40
- package/plugin/runtime/dist/public-config.js +0 -58
- package/plugin/runtime/dist/service-errors.js +0 -11
- package/plugin/runtime/dist/service-host.js +0 -251
- package/plugin/runtime/dist/speech-routes.js +0 -111
- package/plugin/runtime/node_modules/.package-lock.json +0 -436
- package/plugin/runtime/node_modules/@noble/hashes/LICENSE +0 -21
- package/plugin/runtime/node_modules/@noble/hashes/README.md +0 -521
- package/plugin/runtime/node_modules/@noble/hashes/_assert.d.ts +0 -17
- package/plugin/runtime/node_modules/@noble/hashes/_assert.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/_assert.js +0 -18
- package/plugin/runtime/node_modules/@noble/hashes/_assert.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/_blake.d.ts +0 -14
- package/plugin/runtime/node_modules/@noble/hashes/_blake.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/_blake.js +0 -50
- package/plugin/runtime/node_modules/@noble/hashes/_blake.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/_md.d.ts +0 -51
- package/plugin/runtime/node_modules/@noble/hashes/_md.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/_md.js +0 -162
- package/plugin/runtime/node_modules/@noble/hashes/_md.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/_u64.d.ts +0 -55
- package/plugin/runtime/node_modules/@noble/hashes/_u64.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/_u64.js +0 -90
- package/plugin/runtime/node_modules/@noble/hashes/_u64.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/argon2.d.ts +0 -32
- package/plugin/runtime/node_modules/@noble/hashes/argon2.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/argon2.js +0 -401
- package/plugin/runtime/node_modules/@noble/hashes/argon2.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/blake1.d.ts +0 -106
- package/plugin/runtime/node_modules/@noble/hashes/blake1.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/blake1.js +0 -459
- package/plugin/runtime/node_modules/@noble/hashes/blake1.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/blake2.d.ts +0 -116
- package/plugin/runtime/node_modules/@noble/hashes/blake2.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/blake2.js +0 -420
- package/plugin/runtime/node_modules/@noble/hashes/blake2.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/blake2b.d.ts +0 -11
- package/plugin/runtime/node_modules/@noble/hashes/blake2b.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/blake2b.js +0 -14
- package/plugin/runtime/node_modules/@noble/hashes/blake2b.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/blake2s.d.ts +0 -20
- package/plugin/runtime/node_modules/@noble/hashes/blake2s.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/blake2s.js +0 -24
- package/plugin/runtime/node_modules/@noble/hashes/blake2s.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/blake3.d.ts +0 -54
- package/plugin/runtime/node_modules/@noble/hashes/blake3.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/blake3.js +0 -255
- package/plugin/runtime/node_modules/@noble/hashes/blake3.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/crypto.d.ts +0 -2
- package/plugin/runtime/node_modules/@noble/hashes/crypto.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/crypto.js +0 -5
- package/plugin/runtime/node_modules/@noble/hashes/crypto.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/cryptoNode.d.ts +0 -2
- package/plugin/runtime/node_modules/@noble/hashes/cryptoNode.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/cryptoNode.js +0 -18
- package/plugin/runtime/node_modules/@noble/hashes/cryptoNode.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/eskdf.d.ts +0 -47
- package/plugin/runtime/node_modules/@noble/hashes/eskdf.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/eskdf.js +0 -166
- package/plugin/runtime/node_modules/@noble/hashes/eskdf.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/_assert.d.ts +0 -17
- package/plugin/runtime/node_modules/@noble/hashes/esm/_assert.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/_assert.js +0 -15
- package/plugin/runtime/node_modules/@noble/hashes/esm/_assert.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/_blake.d.ts +0 -14
- package/plugin/runtime/node_modules/@noble/hashes/esm/_blake.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/_blake.js +0 -45
- package/plugin/runtime/node_modules/@noble/hashes/esm/_blake.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/_md.d.ts +0 -51
- package/plugin/runtime/node_modules/@noble/hashes/esm/_md.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/_md.js +0 -155
- package/plugin/runtime/node_modules/@noble/hashes/esm/_md.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/_u64.d.ts +0 -55
- package/plugin/runtime/node_modules/@noble/hashes/esm/_u64.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/_u64.js +0 -67
- package/plugin/runtime/node_modules/@noble/hashes/esm/_u64.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/argon2.d.ts +0 -32
- package/plugin/runtime/node_modules/@noble/hashes/esm/argon2.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/argon2.js +0 -392
- package/plugin/runtime/node_modules/@noble/hashes/esm/argon2.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake1.d.ts +0 -106
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake1.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake1.js +0 -452
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake1.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake2.d.ts +0 -116
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake2.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake2.js +0 -413
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake2.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake2b.d.ts +0 -11
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake2b.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake2b.js +0 -11
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake2b.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake2s.d.ts +0 -20
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake2s.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake2s.js +0 -21
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake2s.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake3.d.ts +0 -54
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake3.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake3.js +0 -251
- package/plugin/runtime/node_modules/@noble/hashes/esm/blake3.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/crypto.d.ts +0 -2
- package/plugin/runtime/node_modules/@noble/hashes/esm/crypto.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/crypto.js +0 -2
- package/plugin/runtime/node_modules/@noble/hashes/esm/crypto.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/cryptoNode.d.ts +0 -2
- package/plugin/runtime/node_modules/@noble/hashes/esm/cryptoNode.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/cryptoNode.js +0 -15
- package/plugin/runtime/node_modules/@noble/hashes/esm/cryptoNode.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/eskdf.d.ts +0 -47
- package/plugin/runtime/node_modules/@noble/hashes/esm/eskdf.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/eskdf.js +0 -160
- package/plugin/runtime/node_modules/@noble/hashes/esm/eskdf.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/hkdf.d.ts +0 -36
- package/plugin/runtime/node_modules/@noble/hashes/esm/hkdf.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/hkdf.js +0 -82
- package/plugin/runtime/node_modules/@noble/hashes/esm/hkdf.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/hmac.d.ts +0 -35
- package/plugin/runtime/node_modules/@noble/hashes/esm/hmac.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/hmac.js +0 -86
- package/plugin/runtime/node_modules/@noble/hashes/esm/hmac.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/index.d.ts +0 -2
- package/plugin/runtime/node_modules/@noble/hashes/esm/index.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/index.js +0 -33
- package/plugin/runtime/node_modules/@noble/hashes/esm/index.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/legacy.d.ts +0 -71
- package/plugin/runtime/node_modules/@noble/hashes/esm/legacy.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/legacy.js +0 -281
- package/plugin/runtime/node_modules/@noble/hashes/esm/legacy.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/package.json +0 -10
- package/plugin/runtime/node_modules/@noble/hashes/esm/pbkdf2.d.ts +0 -23
- package/plugin/runtime/node_modules/@noble/hashes/esm/pbkdf2.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/pbkdf2.js +0 -97
- package/plugin/runtime/node_modules/@noble/hashes/esm/pbkdf2.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/ripemd160.d.ts +0 -13
- package/plugin/runtime/node_modules/@noble/hashes/esm/ripemd160.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/ripemd160.js +0 -13
- package/plugin/runtime/node_modules/@noble/hashes/esm/ripemd160.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/scrypt.d.ts +0 -34
- package/plugin/runtime/node_modules/@noble/hashes/esm/scrypt.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/scrypt.js +0 -228
- package/plugin/runtime/node_modules/@noble/hashes/esm/scrypt.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha1.d.ts +0 -11
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha1.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha1.js +0 -11
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha1.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha2.d.ts +0 -159
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha2.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha2.js +0 -375
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha2.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha256.d.ts +0 -20
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha256.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha256.js +0 -20
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha256.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha3-addons.d.ts +0 -142
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha3-addons.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha3-addons.js +0 -393
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha3-addons.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha3.d.ts +0 -53
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha3.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha3.js +0 -234
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha3.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha512.d.ts +0 -26
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha512.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha512.js +0 -26
- package/plugin/runtime/node_modules/@noble/hashes/esm/sha512.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/utils.d.ts +0 -161
- package/plugin/runtime/node_modules/@noble/hashes/esm/utils.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/esm/utils.js +0 -281
- package/plugin/runtime/node_modules/@noble/hashes/esm/utils.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/hkdf.d.ts +0 -36
- package/plugin/runtime/node_modules/@noble/hashes/hkdf.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/hkdf.js +0 -88
- package/plugin/runtime/node_modules/@noble/hashes/hkdf.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/hmac.d.ts +0 -35
- package/plugin/runtime/node_modules/@noble/hashes/hmac.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/hmac.js +0 -91
- package/plugin/runtime/node_modules/@noble/hashes/hmac.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/index.d.ts +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/index.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/index.js +0 -33
- package/plugin/runtime/node_modules/@noble/hashes/index.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/legacy.d.ts +0 -71
- package/plugin/runtime/node_modules/@noble/hashes/legacy.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/legacy.js +0 -287
- package/plugin/runtime/node_modules/@noble/hashes/legacy.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/package.json +0 -266
- package/plugin/runtime/node_modules/@noble/hashes/pbkdf2.d.ts +0 -23
- package/plugin/runtime/node_modules/@noble/hashes/pbkdf2.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/pbkdf2.js +0 -101
- package/plugin/runtime/node_modules/@noble/hashes/pbkdf2.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/ripemd160.d.ts +0 -13
- package/plugin/runtime/node_modules/@noble/hashes/ripemd160.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/ripemd160.js +0 -16
- package/plugin/runtime/node_modules/@noble/hashes/ripemd160.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/scrypt.d.ts +0 -34
- package/plugin/runtime/node_modules/@noble/hashes/scrypt.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/scrypt.js +0 -232
- package/plugin/runtime/node_modules/@noble/hashes/scrypt.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/sha1.d.ts +0 -11
- package/plugin/runtime/node_modules/@noble/hashes/sha1.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/sha1.js +0 -14
- package/plugin/runtime/node_modules/@noble/hashes/sha1.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/sha2.d.ts +0 -159
- package/plugin/runtime/node_modules/@noble/hashes/sha2.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/sha2.js +0 -384
- package/plugin/runtime/node_modules/@noble/hashes/sha2.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/sha256.d.ts +0 -20
- package/plugin/runtime/node_modules/@noble/hashes/sha256.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/sha256.js +0 -23
- package/plugin/runtime/node_modules/@noble/hashes/sha256.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/sha3-addons.d.ts +0 -142
- package/plugin/runtime/node_modules/@noble/hashes/sha3-addons.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/sha3-addons.js +0 -402
- package/plugin/runtime/node_modules/@noble/hashes/sha3-addons.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/sha3.d.ts +0 -53
- package/plugin/runtime/node_modules/@noble/hashes/sha3.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/sha3.js +0 -239
- package/plugin/runtime/node_modules/@noble/hashes/sha3.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/sha512.d.ts +0 -26
- package/plugin/runtime/node_modules/@noble/hashes/sha512.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/sha512.js +0 -29
- package/plugin/runtime/node_modules/@noble/hashes/sha512.js.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/src/_assert.ts +0 -22
- package/plugin/runtime/node_modules/@noble/hashes/src/_blake.ts +0 -50
- package/plugin/runtime/node_modules/@noble/hashes/src/_md.ts +0 -176
- package/plugin/runtime/node_modules/@noble/hashes/src/_u64.ts +0 -91
- package/plugin/runtime/node_modules/@noble/hashes/src/argon2.ts +0 -497
- package/plugin/runtime/node_modules/@noble/hashes/src/blake1.ts +0 -534
- package/plugin/runtime/node_modules/@noble/hashes/src/blake2.ts +0 -486
- package/plugin/runtime/node_modules/@noble/hashes/src/blake2b.ts +0 -10
- package/plugin/runtime/node_modules/@noble/hashes/src/blake2s.ts +0 -20
- package/plugin/runtime/node_modules/@noble/hashes/src/blake3.ts +0 -272
- package/plugin/runtime/node_modules/@noble/hashes/src/crypto.ts +0 -9
- package/plugin/runtime/node_modules/@noble/hashes/src/cryptoNode.ts +0 -15
- package/plugin/runtime/node_modules/@noble/hashes/src/eskdf.ts +0 -187
- package/plugin/runtime/node_modules/@noble/hashes/src/hkdf.ts +0 -88
- package/plugin/runtime/node_modules/@noble/hashes/src/hmac.ts +0 -94
- package/plugin/runtime/node_modules/@noble/hashes/src/index.ts +0 -31
- package/plugin/runtime/node_modules/@noble/hashes/src/legacy.ts +0 -293
- package/plugin/runtime/node_modules/@noble/hashes/src/pbkdf2.ts +0 -122
- package/plugin/runtime/node_modules/@noble/hashes/src/ripemd160.ts +0 -12
- package/plugin/runtime/node_modules/@noble/hashes/src/scrypt.ts +0 -257
- package/plugin/runtime/node_modules/@noble/hashes/src/sha1.ts +0 -10
- package/plugin/runtime/node_modules/@noble/hashes/src/sha2.ts +0 -402
- package/plugin/runtime/node_modules/@noble/hashes/src/sha256.ts +0 -24
- package/plugin/runtime/node_modules/@noble/hashes/src/sha3-addons.ts +0 -499
- package/plugin/runtime/node_modules/@noble/hashes/src/sha3.ts +0 -258
- package/plugin/runtime/node_modules/@noble/hashes/src/sha512.ts +0 -34
- package/plugin/runtime/node_modules/@noble/hashes/src/utils.ts +0 -395
- package/plugin/runtime/node_modules/@noble/hashes/utils.d.ts +0 -161
- package/plugin/runtime/node_modules/@noble/hashes/utils.d.ts.map +0 -1
- package/plugin/runtime/node_modules/@noble/hashes/utils.js +0 -313
- package/plugin/runtime/node_modules/@noble/hashes/utils.js.map +0 -1
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/API.md +0 -416
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/LICENSE +0 -21
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/README.md +0 -77
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/attachment/store.d.ts +0 -57
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/attachment/store.js +0 -618
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/attest/attest-gate.d.ts +0 -29
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/attest/attest-gate.js +0 -58
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/attest/attest-key-prune.d.ts +0 -17
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/attest/attest-key-prune.js +0 -37
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/attest/attest-store.d.ts +0 -27
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/attest/attest-store.js +0 -146
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/attest/verifier.d.ts +0 -1
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/attest/verifier.js +0 -2
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/delivery-observations.d.ts +0 -38
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/delivery-observations.js +0 -85
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/history.d.ts +0 -88
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/history.js +0 -176
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/pairing-codec.d.ts +0 -39
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/pairing-codec.js +0 -233
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/reconciliation.d.ts +0 -6
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/reconciliation.js +0 -17
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/types.d.ts +0 -234
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/contract/types.js +0 -32
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/device-request/coordinator.d.ts +0 -19
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/device-request/coordinator.js +0 -113
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/device-request/pending-store.d.ts +0 -37
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/device-request/pending-store.js +0 -67
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/device-request/results.d.ts +0 -14
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/device-request/results.js +0 -39
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/index.d.ts +0 -16
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/index.js +0 -15
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/link-preview/og-parse.d.ts +0 -21
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/link-preview/og-parse.js +0 -234
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/link-preview/preview-service.d.ts +0 -39
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/link-preview/preview-service.js +0 -232
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/link-preview/ssrf-guard.d.ts +0 -52
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/link-preview/ssrf-guard.js +0 -236
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/prompt-capsules/capsules-store.d.ts +0 -38
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/prompt-capsules/capsules-store.js +0 -149
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/attachment-crypto.d.ts +0 -4
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/attachment-crypto.js +0 -73
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/cert-selfsign.d.ts +0 -6
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/cert-selfsign.js +0 -88
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/filter-proxy.d.ts +0 -17
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/filter-proxy.js +0 -231
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/frpc-manager.d.ts +0 -76
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/frpc-manager.js +0 -1332
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/oss-transfer.d.ts +0 -43
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/oss-transfer.js +0 -280
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/pairing-voucher.d.ts +0 -13
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/pairing-voucher.js +0 -58
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/private-file.d.ts +0 -2
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/private-file.js +0 -11
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/standby-loop-guard.d.ts +0 -9
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/standby-loop-guard.js +0 -24
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/tls-identity.d.ts +0 -36
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/tls-identity.js +0 -151
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/tunnel-watchdog-policy.d.ts +0 -24
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/public-access/tunnel-watchdog-policy.js +0 -49
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/push/push-runtime.d.ts +0 -45
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/push/push-runtime.js +0 -233
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/push/relay-transport.d.ts +0 -8
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/push/relay-transport.js +0 -27
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/channel-kernel.d.ts +0 -49
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/channel-kernel.js +0 -307
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/channel-runtime.d.ts +0 -2
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/channel-runtime.js +0 -2
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/delivery-observation-publisher.d.ts +0 -43
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/delivery-observation-publisher.js +0 -211
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/durable-run-store.d.ts +0 -247
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/durable-run-store.js +0 -1525
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/runner.d.ts +0 -36
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/runner.js +0 -269
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/scheduler.d.ts +0 -13
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/runtime/scheduler.js +0 -130
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/server-name/server-name-store.d.ts +0 -21
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/server-name/server-name-store.js +0 -52
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/service/channel-service.d.ts +0 -38
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/service/channel-service.js +0 -266
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/service/infrastructure.d.ts +0 -87
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/service/infrastructure.js +0 -179
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/testing/contract-harness.d.ts +0 -25
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/testing/contract-harness.js +0 -44
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/testing/reference-adapter.d.ts +0 -39
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/testing/reference-adapter.js +0 -76
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/testing/weaknet-server.d.ts +0 -6
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/testing/weaknet-server.js +0 -130
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/attest.d.ts +0 -39
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/attest.js +0 -114
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/body.d.ts +0 -2
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/body.js +0 -24
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/controls.d.ts +0 -9
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/controls.js +0 -112
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/files-download.d.ts +0 -18
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/files-download.js +0 -197
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/files-upload.d.ts +0 -20
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/files-upload.js +0 -227
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/link-preview.d.ts +0 -15
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/link-preview.js +0 -45
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/messages.d.ts +0 -10
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/messages.js +0 -105
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/pairing.d.ts +0 -22
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/pairing.js +0 -138
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/prompt-capsules.d.ts +0 -8
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/prompt-capsules.js +0 -65
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/push.d.ts +0 -13
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/push.js +0 -65
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/runtime.d.ts +0 -50
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/runtime.js +0 -400
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/server-name.d.ts +0 -8
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/server-name.js +0 -43
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/session-settings.d.ts +0 -5
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/session-settings.js +0 -121
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/sessions.d.ts +0 -20
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/dist/transport/sessions.js +0 -118
- package/plugin/runtime/node_modules/@syengup/fridaynext-channel-kit/package.json +0 -40
- package/plugin/runtime/node_modules/ansi-regex/index.d.ts +0 -37
- package/plugin/runtime/node_modules/ansi-regex/index.js +0 -10
- package/plugin/runtime/node_modules/ansi-regex/license +0 -9
- package/plugin/runtime/node_modules/ansi-regex/package.json +0 -55
- package/plugin/runtime/node_modules/ansi-regex/readme.md +0 -78
- package/plugin/runtime/node_modules/ansi-styles/index.d.ts +0 -345
- package/plugin/runtime/node_modules/ansi-styles/index.js +0 -163
- package/plugin/runtime/node_modules/ansi-styles/license +0 -9
- package/plugin/runtime/node_modules/ansi-styles/package.json +0 -56
- package/plugin/runtime/node_modules/ansi-styles/readme.md +0 -152
- package/plugin/runtime/node_modules/asn1js/LICENSE +0 -30
- package/plugin/runtime/node_modules/asn1js/README.md +0 -222
- package/plugin/runtime/node_modules/asn1js/build/index.d.ts +0 -1412
- package/plugin/runtime/node_modules/asn1js/build/index.es.js +0 -3705
- package/plugin/runtime/node_modules/asn1js/build/index.js +0 -3773
- package/plugin/runtime/node_modules/asn1js/package.json +0 -89
- package/plugin/runtime/node_modules/bytestreamjs/LICENSE +0 -29
- package/plugin/runtime/node_modules/bytestreamjs/README.MD +0 -196
- package/plugin/runtime/node_modules/bytestreamjs/build/cjs/bit.js +0 -91
- package/plugin/runtime/node_modules/bytestreamjs/build/cjs/bit_stream.js +0 -400
- package/plugin/runtime/node_modules/bytestreamjs/build/cjs/byte_stream.js +0 -648
- package/plugin/runtime/node_modules/bytestreamjs/build/cjs/helpers.js +0 -59
- package/plugin/runtime/node_modules/bytestreamjs/build/cjs/index.js +0 -21
- package/plugin/runtime/node_modules/bytestreamjs/build/cjs/seq_bit_stream.js +0 -114
- package/plugin/runtime/node_modules/bytestreamjs/build/cjs/seq_stream.js +0 -437
- package/plugin/runtime/node_modules/bytestreamjs/build/mjs/bit.js +0 -88
- package/plugin/runtime/node_modules/bytestreamjs/build/mjs/bit_stream.js +0 -396
- package/plugin/runtime/node_modules/bytestreamjs/build/mjs/byte_stream.js +0 -644
- package/plugin/runtime/node_modules/bytestreamjs/build/mjs/helpers.js +0 -55
- package/plugin/runtime/node_modules/bytestreamjs/build/mjs/index.js +0 -5
- package/plugin/runtime/node_modules/bytestreamjs/build/mjs/seq_bit_stream.js +0 -110
- package/plugin/runtime/node_modules/bytestreamjs/build/mjs/seq_stream.js +0 -433
- package/plugin/runtime/node_modules/bytestreamjs/build/types/bit.d.ts +0 -1
- package/plugin/runtime/node_modules/bytestreamjs/build/types/bit_stream.d.ts +0 -222
- package/plugin/runtime/node_modules/bytestreamjs/build/types/byte_stream.d.ts +0 -292
- package/plugin/runtime/node_modules/bytestreamjs/build/types/helpers.d.ts +0 -23
- package/plugin/runtime/node_modules/bytestreamjs/build/types/index.d.ts +0 -5
- package/plugin/runtime/node_modules/bytestreamjs/build/types/seq_bit_stream.d.ts +0 -47
- package/plugin/runtime/node_modules/bytestreamjs/build/types/seq_stream.d.ts +0 -255
- package/plugin/runtime/node_modules/bytestreamjs/package.json +0 -66
- package/plugin/runtime/node_modules/camelcase/index.d.ts +0 -63
- package/plugin/runtime/node_modules/camelcase/index.js +0 -76
- package/plugin/runtime/node_modules/camelcase/license +0 -9
- package/plugin/runtime/node_modules/camelcase/package.json +0 -43
- package/plugin/runtime/node_modules/camelcase/readme.md +0 -99
- package/plugin/runtime/node_modules/cbor/LICENSE.md +0 -20
- package/plugin/runtime/node_modules/cbor/README.md +0 -282
- package/plugin/runtime/node_modules/cbor/lib/cbor.js +0 -114
- package/plugin/runtime/node_modules/cbor/lib/commented.js +0 -382
- package/plugin/runtime/node_modules/cbor/lib/constants.js +0 -79
- package/plugin/runtime/node_modules/cbor/lib/decoder.js +0 -680
- package/plugin/runtime/node_modules/cbor/lib/diagnose.js +0 -274
- package/plugin/runtime/node_modules/cbor/lib/encoder.js +0 -1121
- package/plugin/runtime/node_modules/cbor/lib/map.js +0 -185
- package/plugin/runtime/node_modules/cbor/lib/objectRecorder.js +0 -71
- package/plugin/runtime/node_modules/cbor/lib/sharedValueEncoder.js +0 -141
- package/plugin/runtime/node_modules/cbor/lib/simple.js +0 -104
- package/plugin/runtime/node_modules/cbor/lib/tagged.js +0 -378
- package/plugin/runtime/node_modules/cbor/lib/utils.js +0 -308
- package/plugin/runtime/node_modules/cbor/package.json +0 -47
- package/plugin/runtime/node_modules/cbor/types/lib/cbor.d.ts +0 -34
- package/plugin/runtime/node_modules/cbor/types/lib/commented.d.ts +0 -109
- package/plugin/runtime/node_modules/cbor/types/lib/constants.d.ts +0 -63
- package/plugin/runtime/node_modules/cbor/types/lib/decoder.d.ts +0 -199
- package/plugin/runtime/node_modules/cbor/types/lib/diagnose.d.ts +0 -91
- package/plugin/runtime/node_modules/cbor/types/lib/encoder.d.ts +0 -477
- package/plugin/runtime/node_modules/cbor/types/lib/map.d.ts +0 -78
- package/plugin/runtime/node_modules/cbor/types/lib/objectRecorder.d.ts +0 -36
- package/plugin/runtime/node_modules/cbor/types/lib/sharedValueEncoder.d.ts +0 -21
- package/plugin/runtime/node_modules/cbor/types/lib/simple.d.ts +0 -47
- package/plugin/runtime/node_modules/cbor/types/lib/tagged.d.ts +0 -74
- package/plugin/runtime/node_modules/cbor/types/lib/utils.d.ts +0 -20
- package/plugin/runtime/node_modules/cbor/types/vendor/binary-parse-stream/index.d.ts +0 -34
- package/plugin/runtime/node_modules/cbor/vendor/binary-parse-stream/README.md +0 -49
- package/plugin/runtime/node_modules/cbor/vendor/binary-parse-stream/index.js +0 -111
- package/plugin/runtime/node_modules/cliui/CHANGELOG.md +0 -76
- package/plugin/runtime/node_modules/cliui/LICENSE.txt +0 -14
- package/plugin/runtime/node_modules/cliui/README.md +0 -115
- package/plugin/runtime/node_modules/cliui/index.js +0 -354
- package/plugin/runtime/node_modules/cliui/package.json +0 -65
- package/plugin/runtime/node_modules/color-convert/CHANGELOG.md +0 -54
- package/plugin/runtime/node_modules/color-convert/LICENSE +0 -21
- package/plugin/runtime/node_modules/color-convert/README.md +0 -68
- package/plugin/runtime/node_modules/color-convert/conversions.js +0 -839
- package/plugin/runtime/node_modules/color-convert/index.js +0 -81
- package/plugin/runtime/node_modules/color-convert/package.json +0 -48
- package/plugin/runtime/node_modules/color-convert/route.js +0 -97
- package/plugin/runtime/node_modules/color-name/LICENSE +0 -8
- package/plugin/runtime/node_modules/color-name/README.md +0 -11
- package/plugin/runtime/node_modules/color-name/index.js +0 -152
- package/plugin/runtime/node_modules/color-name/package.json +0 -28
- package/plugin/runtime/node_modules/decamelize/index.js +0 -13
- package/plugin/runtime/node_modules/decamelize/license +0 -21
- package/plugin/runtime/node_modules/decamelize/package.json +0 -38
- package/plugin/runtime/node_modules/decamelize/readme.md +0 -48
- package/plugin/runtime/node_modules/dijkstrajs/.travis.yml +0 -4
- package/plugin/runtime/node_modules/dijkstrajs/CONTRIBUTING.md +0 -8
- package/plugin/runtime/node_modules/dijkstrajs/LICENSE.md +0 -19
- package/plugin/runtime/node_modules/dijkstrajs/README.md +0 -18
- package/plugin/runtime/node_modules/dijkstrajs/dijkstra.js +0 -165
- package/plugin/runtime/node_modules/dijkstrajs/package.json +0 -60
- package/plugin/runtime/node_modules/dijkstrajs/test/dijkstra.test.js +0 -96
- package/plugin/runtime/node_modules/emoji-regex/LICENSE-MIT.txt +0 -20
- package/plugin/runtime/node_modules/emoji-regex/README.md +0 -73
- package/plugin/runtime/node_modules/emoji-regex/es2015/index.js +0 -6
- package/plugin/runtime/node_modules/emoji-regex/es2015/text.js +0 -6
- package/plugin/runtime/node_modules/emoji-regex/index.d.ts +0 -23
- package/plugin/runtime/node_modules/emoji-regex/index.js +0 -6
- package/plugin/runtime/node_modules/emoji-regex/package.json +0 -50
- package/plugin/runtime/node_modules/emoji-regex/text.js +0 -6
- package/plugin/runtime/node_modules/find-up/index.d.ts +0 -137
- package/plugin/runtime/node_modules/find-up/index.js +0 -89
- package/plugin/runtime/node_modules/find-up/license +0 -9
- package/plugin/runtime/node_modules/find-up/package.json +0 -53
- package/plugin/runtime/node_modules/find-up/readme.md +0 -156
- package/plugin/runtime/node_modules/get-caller-file/LICENSE.md +0 -6
- package/plugin/runtime/node_modules/get-caller-file/README.md +0 -41
- package/plugin/runtime/node_modules/get-caller-file/index.d.ts +0 -2
- package/plugin/runtime/node_modules/get-caller-file/index.js +0 -22
- package/plugin/runtime/node_modules/get-caller-file/index.js.map +0 -1
- package/plugin/runtime/node_modules/get-caller-file/package.json +0 -42
- package/plugin/runtime/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
- package/plugin/runtime/node_modules/is-fullwidth-code-point/index.js +0 -50
- package/plugin/runtime/node_modules/is-fullwidth-code-point/license +0 -9
- package/plugin/runtime/node_modules/is-fullwidth-code-point/package.json +0 -42
- package/plugin/runtime/node_modules/is-fullwidth-code-point/readme.md +0 -39
- package/plugin/runtime/node_modules/locate-path/index.d.ts +0 -83
- package/plugin/runtime/node_modules/locate-path/index.js +0 -65
- package/plugin/runtime/node_modules/locate-path/license +0 -9
- package/plugin/runtime/node_modules/locate-path/package.json +0 -45
- package/plugin/runtime/node_modules/locate-path/readme.md +0 -122
- package/plugin/runtime/node_modules/node-app-attest/.github/dependabot.yml +0 -6
- package/plugin/runtime/node_modules/node-app-attest/.github/workflows/ci.yml +0 -43
- package/plugin/runtime/node_modules/node-app-attest/.prettierrc +0 -1
- package/plugin/runtime/node_modules/node-app-attest/.yarnrc.yml +0 -1
- package/plugin/runtime/node_modules/node-app-attest/LICENSE +0 -21
- package/plugin/runtime/node_modules/node-app-attest/README.md +0 -300
- package/plugin/runtime/node_modules/node-app-attest/eslint.config.js +0 -30
- package/plugin/runtime/node_modules/node-app-attest/package.json +0 -44
- package/plugin/runtime/node_modules/node-app-attest/src/index.js +0 -4
- package/plugin/runtime/node_modules/node-app-attest/src/verifyAssertion.js +0 -81
- package/plugin/runtime/node_modules/node-app-attest/src/verifyAttestation.js +0 -211
- package/plugin/runtime/node_modules/node-app-attest/test/fixtures/attestation-development.json +0 -5
- package/plugin/runtime/node_modules/node-app-attest/test/fixtures/attestation-production.json +0 -5
- package/plugin/runtime/node_modules/node-app-attest/test/verifyAssertion.test.js +0 -119
- package/plugin/runtime/node_modules/node-app-attest/test/verifyAttestation.test.js +0 -303
- package/plugin/runtime/node_modules/node-app-attest/tsconfig.json +0 -11
- package/plugin/runtime/node_modules/node-app-attest/types/index.d.ts +0 -4
- package/plugin/runtime/node_modules/node-app-attest/types/index.d.ts.map +0 -1
- package/plugin/runtime/node_modules/node-app-attest/types/verifyAssertion.d.ts +0 -5
- package/plugin/runtime/node_modules/node-app-attest/types/verifyAssertion.d.ts.map +0 -1
- package/plugin/runtime/node_modules/node-app-attest/types/verifyAttestation.d.ts +0 -8
- package/plugin/runtime/node_modules/node-app-attest/types/verifyAttestation.d.ts.map +0 -1
- package/plugin/runtime/node_modules/nofilter/LICENSE.md +0 -20
- package/plugin/runtime/node_modules/nofilter/README.md +0 -36
- package/plugin/runtime/node_modules/nofilter/lib/index.js +0 -1055
- package/plugin/runtime/node_modules/nofilter/package.json +0 -60
- package/plugin/runtime/node_modules/nofilter/types/index.d.ts +0 -573
- package/plugin/runtime/node_modules/p-limit/index.d.ts +0 -38
- package/plugin/runtime/node_modules/p-limit/index.js +0 -57
- package/plugin/runtime/node_modules/p-limit/license +0 -9
- package/plugin/runtime/node_modules/p-limit/package.json +0 -52
- package/plugin/runtime/node_modules/p-limit/readme.md +0 -101
- package/plugin/runtime/node_modules/p-locate/index.d.ts +0 -64
- package/plugin/runtime/node_modules/p-locate/index.js +0 -52
- package/plugin/runtime/node_modules/p-locate/license +0 -9
- package/plugin/runtime/node_modules/p-locate/package.json +0 -53
- package/plugin/runtime/node_modules/p-locate/readme.md +0 -90
- package/plugin/runtime/node_modules/p-try/index.d.ts +0 -39
- package/plugin/runtime/node_modules/p-try/index.js +0 -9
- package/plugin/runtime/node_modules/p-try/license +0 -9
- package/plugin/runtime/node_modules/p-try/package.json +0 -42
- package/plugin/runtime/node_modules/p-try/readme.md +0 -58
- package/plugin/runtime/node_modules/path-exists/index.d.ts +0 -28
- package/plugin/runtime/node_modules/path-exists/index.js +0 -23
- package/plugin/runtime/node_modules/path-exists/license +0 -9
- package/plugin/runtime/node_modules/path-exists/package.json +0 -39
- package/plugin/runtime/node_modules/path-exists/readme.md +0 -52
- package/plugin/runtime/node_modules/pkijs/LICENSE +0 -30
- package/plugin/runtime/node_modules/pkijs/README.md +0 -81
- package/plugin/runtime/node_modules/pkijs/build/index.d.ts +0 -9419
- package/plugin/runtime/node_modules/pkijs/build/index.es.js +0 -18789
- package/plugin/runtime/node_modules/pkijs/build/index.js +0 -19014
- package/plugin/runtime/node_modules/pkijs/package.json +0 -98
- package/plugin/runtime/node_modules/pngjs/.eslintignore +0 -2
- package/plugin/runtime/node_modules/pngjs/.eslintrc.json +0 -19
- package/plugin/runtime/node_modules/pngjs/.prettierignore +0 -3
- package/plugin/runtime/node_modules/pngjs/LICENSE +0 -20
- package/plugin/runtime/node_modules/pngjs/README.md +0 -429
- package/plugin/runtime/node_modules/pngjs/browser.js +0 -16096
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/base.css +0 -354
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/bitmapper.js.html +0 -881
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/bitpacker.js.html +0 -554
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/block-navigation.js +0 -77
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/chunkstream.js.html +0 -647
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/constants.js.html +0 -176
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/crc.js.html +0 -200
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/favicon.png +0 -0
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/filter-pack.js.html +0 -593
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/filter-parse-async.js.html +0 -152
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/filter-parse-sync.js.html +0 -143
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/filter-parse.js.html +0 -611
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/format-normaliser.js.html +0 -359
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/index.html +0 -426
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/interlace.js.html +0 -365
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/packer-async.js.html +0 -230
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/packer-sync.js.html +0 -248
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/packer.js.html +0 -467
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/paeth-predictor.js.html +0 -128
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/parser-async.js.html +0 -575
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/parser-sync.js.html +0 -404
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/parser.js.html +0 -950
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/png-sync.js.html +0 -116
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/png.js.html +0 -662
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/prettify.css +0 -101
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/prettify.js +0 -1007
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/sorter.js +0 -169
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/sync-inflate.js.html +0 -584
- package/plugin/runtime/node_modules/pngjs/coverage/lcov-report/sync-reader.js.html +0 -215
- package/plugin/runtime/node_modules/pngjs/coverage/lcov.info +0 -2177
- package/plugin/runtime/node_modules/pngjs/lib/bitmapper.js +0 -267
- package/plugin/runtime/node_modules/pngjs/lib/bitpacker.js +0 -158
- package/plugin/runtime/node_modules/pngjs/lib/chunkstream.js +0 -189
- package/plugin/runtime/node_modules/pngjs/lib/constants.js +0 -32
- package/plugin/runtime/node_modules/pngjs/lib/crc.js +0 -40
- package/plugin/runtime/node_modules/pngjs/lib/filter-pack.js +0 -171
- package/plugin/runtime/node_modules/pngjs/lib/filter-parse-async.js +0 -24
- package/plugin/runtime/node_modules/pngjs/lib/filter-parse-sync.js +0 -21
- package/plugin/runtime/node_modules/pngjs/lib/filter-parse.js +0 -177
- package/plugin/runtime/node_modules/pngjs/lib/format-normaliser.js +0 -93
- package/plugin/runtime/node_modules/pngjs/lib/interlace.js +0 -95
- package/plugin/runtime/node_modules/pngjs/lib/packer-async.js +0 -50
- package/plugin/runtime/node_modules/pngjs/lib/packer-sync.js +0 -56
- package/plugin/runtime/node_modules/pngjs/lib/packer.js +0 -129
- package/plugin/runtime/node_modules/pngjs/lib/paeth-predictor.js +0 -16
- package/plugin/runtime/node_modules/pngjs/lib/parser-async.js +0 -165
- package/plugin/runtime/node_modules/pngjs/lib/parser-sync.js +0 -108
- package/plugin/runtime/node_modules/pngjs/lib/parser.js +0 -290
- package/plugin/runtime/node_modules/pngjs/lib/png-sync.js +0 -12
- package/plugin/runtime/node_modules/pngjs/lib/png.js +0 -194
- package/plugin/runtime/node_modules/pngjs/lib/sync-inflate.js +0 -168
- package/plugin/runtime/node_modules/pngjs/lib/sync-reader.js +0 -45
- package/plugin/runtime/node_modules/pngjs/package.json +0 -73
- package/plugin/runtime/node_modules/pvtsutils/LICENSE +0 -21
- package/plugin/runtime/node_modules/pvtsutils/README.md +0 -80
- package/plugin/runtime/node_modules/pvtsutils/build/index.d.ts +0 -208
- package/plugin/runtime/node_modules/pvtsutils/build/index.es.js +0 -393
- package/plugin/runtime/node_modules/pvtsutils/build/index.js +0 -399
- package/plugin/runtime/node_modules/pvtsutils/package.json +0 -76
- package/plugin/runtime/node_modules/pvutils/LICENSE +0 -24
- package/plugin/runtime/node_modules/pvutils/README.md +0 -24
- package/plugin/runtime/node_modules/pvutils/build/index.d.ts +0 -116
- package/plugin/runtime/node_modules/pvutils/build/utils.es.js +0 -340
- package/plugin/runtime/node_modules/pvutils/build/utils.js +0 -361
- package/plugin/runtime/node_modules/pvutils/package.json +0 -63
- package/plugin/runtime/node_modules/qrcode/README.md +0 -770
- package/plugin/runtime/node_modules/qrcode/bin/qrcode +0 -159
- package/plugin/runtime/node_modules/qrcode/helper/to-sjis-browser.js +0 -2
- package/plugin/runtime/node_modules/qrcode/helper/to-sjis.js +0 -105
- package/plugin/runtime/node_modules/qrcode/lib/browser.js +0 -76
- package/plugin/runtime/node_modules/qrcode/lib/can-promise.js +0 -7
- package/plugin/runtime/node_modules/qrcode/lib/core/alignment-pattern.js +0 -83
- package/plugin/runtime/node_modules/qrcode/lib/core/alphanumeric-data.js +0 -59
- package/plugin/runtime/node_modules/qrcode/lib/core/bit-buffer.js +0 -37
- package/plugin/runtime/node_modules/qrcode/lib/core/bit-matrix.js +0 -65
- package/plugin/runtime/node_modules/qrcode/lib/core/byte-data.js +0 -30
- package/plugin/runtime/node_modules/qrcode/lib/core/error-correction-code.js +0 -135
- package/plugin/runtime/node_modules/qrcode/lib/core/error-correction-level.js +0 -50
- package/plugin/runtime/node_modules/qrcode/lib/core/finder-pattern.js +0 -22
- package/plugin/runtime/node_modules/qrcode/lib/core/format-info.js +0 -29
- package/plugin/runtime/node_modules/qrcode/lib/core/galois-field.js +0 -69
- package/plugin/runtime/node_modules/qrcode/lib/core/kanji-data.js +0 -54
- package/plugin/runtime/node_modules/qrcode/lib/core/mask-pattern.js +0 -234
- package/plugin/runtime/node_modules/qrcode/lib/core/mode.js +0 -167
- package/plugin/runtime/node_modules/qrcode/lib/core/numeric-data.js +0 -43
- package/plugin/runtime/node_modules/qrcode/lib/core/polynomial.js +0 -62
- package/plugin/runtime/node_modules/qrcode/lib/core/qrcode.js +0 -495
- package/plugin/runtime/node_modules/qrcode/lib/core/reed-solomon-encoder.js +0 -56
- package/plugin/runtime/node_modules/qrcode/lib/core/regex.js +0 -31
- package/plugin/runtime/node_modules/qrcode/lib/core/segments.js +0 -330
- package/plugin/runtime/node_modules/qrcode/lib/core/utils.js +0 -63
- package/plugin/runtime/node_modules/qrcode/lib/core/version-check.js +0 -9
- package/plugin/runtime/node_modules/qrcode/lib/core/version.js +0 -163
- package/plugin/runtime/node_modules/qrcode/lib/index.js +0 -12
- package/plugin/runtime/node_modules/qrcode/lib/renderer/canvas.js +0 -63
- package/plugin/runtime/node_modules/qrcode/lib/renderer/png.js +0 -78
- package/plugin/runtime/node_modules/qrcode/lib/renderer/svg-tag.js +0 -81
- package/plugin/runtime/node_modules/qrcode/lib/renderer/svg.js +0 -19
- package/plugin/runtime/node_modules/qrcode/lib/renderer/terminal/terminal-small.js +0 -85
- package/plugin/runtime/node_modules/qrcode/lib/renderer/terminal/terminal.js +0 -49
- package/plugin/runtime/node_modules/qrcode/lib/renderer/terminal.js +0 -9
- package/plugin/runtime/node_modules/qrcode/lib/renderer/utf8.js +0 -71
- package/plugin/runtime/node_modules/qrcode/lib/renderer/utils.js +0 -99
- package/plugin/runtime/node_modules/qrcode/lib/server.js +0 -138
- package/plugin/runtime/node_modules/qrcode/license +0 -10
- package/plugin/runtime/node_modules/qrcode/package.json +0 -77
- package/plugin/runtime/node_modules/require-directory/.jshintrc +0 -67
- package/plugin/runtime/node_modules/require-directory/.travis.yml +0 -3
- package/plugin/runtime/node_modules/require-directory/LICENSE +0 -22
- package/plugin/runtime/node_modules/require-directory/README.markdown +0 -184
- package/plugin/runtime/node_modules/require-directory/index.js +0 -86
- package/plugin/runtime/node_modules/require-directory/package.json +0 -40
- package/plugin/runtime/node_modules/require-main-filename/CHANGELOG.md +0 -26
- package/plugin/runtime/node_modules/require-main-filename/LICENSE.txt +0 -14
- package/plugin/runtime/node_modules/require-main-filename/README.md +0 -26
- package/plugin/runtime/node_modules/require-main-filename/index.js +0 -18
- package/plugin/runtime/node_modules/require-main-filename/package.json +0 -35
- package/plugin/runtime/node_modules/set-blocking/CHANGELOG.md +0 -26
- package/plugin/runtime/node_modules/set-blocking/LICENSE.txt +0 -14
- package/plugin/runtime/node_modules/set-blocking/README.md +0 -31
- package/plugin/runtime/node_modules/set-blocking/index.js +0 -7
- package/plugin/runtime/node_modules/set-blocking/package.json +0 -42
- package/plugin/runtime/node_modules/string-width/index.d.ts +0 -29
- package/plugin/runtime/node_modules/string-width/index.js +0 -47
- package/plugin/runtime/node_modules/string-width/license +0 -9
- package/plugin/runtime/node_modules/string-width/package.json +0 -56
- package/plugin/runtime/node_modules/string-width/readme.md +0 -50
- package/plugin/runtime/node_modules/strip-ansi/index.d.ts +0 -17
- package/plugin/runtime/node_modules/strip-ansi/index.js +0 -4
- package/plugin/runtime/node_modules/strip-ansi/license +0 -9
- package/plugin/runtime/node_modules/strip-ansi/package.json +0 -54
- package/plugin/runtime/node_modules/strip-ansi/readme.md +0 -46
- package/plugin/runtime/node_modules/tslib/CopyrightNotice.txt +0 -15
- package/plugin/runtime/node_modules/tslib/LICENSE.txt +0 -12
- package/plugin/runtime/node_modules/tslib/README.md +0 -164
- package/plugin/runtime/node_modules/tslib/SECURITY.md +0 -41
- package/plugin/runtime/node_modules/tslib/modules/index.d.ts +0 -38
- package/plugin/runtime/node_modules/tslib/modules/index.js +0 -70
- package/plugin/runtime/node_modules/tslib/modules/package.json +0 -3
- package/plugin/runtime/node_modules/tslib/package.json +0 -47
- package/plugin/runtime/node_modules/tslib/tslib.d.ts +0 -460
- package/plugin/runtime/node_modules/tslib/tslib.es6.html +0 -1
- package/plugin/runtime/node_modules/tslib/tslib.es6.js +0 -402
- package/plugin/runtime/node_modules/tslib/tslib.es6.mjs +0 -401
- package/plugin/runtime/node_modules/tslib/tslib.html +0 -1
- package/plugin/runtime/node_modules/tslib/tslib.js +0 -484
- package/plugin/runtime/node_modules/which-module/LICENSE +0 -13
- package/plugin/runtime/node_modules/which-module/README.md +0 -58
- package/plugin/runtime/node_modules/which-module/index.js +0 -9
- package/plugin/runtime/node_modules/which-module/package.json +0 -41
- package/plugin/runtime/node_modules/wrap-ansi/index.js +0 -186
- package/plugin/runtime/node_modules/wrap-ansi/license +0 -9
- package/plugin/runtime/node_modules/wrap-ansi/package.json +0 -61
- package/plugin/runtime/node_modules/wrap-ansi/readme.md +0 -97
- package/plugin/runtime/node_modules/y18n/CHANGELOG.md +0 -35
- package/plugin/runtime/node_modules/y18n/LICENSE +0 -13
- package/plugin/runtime/node_modules/y18n/README.md +0 -109
- package/plugin/runtime/node_modules/y18n/index.js +0 -188
- package/plugin/runtime/node_modules/y18n/package.json +0 -39
- package/plugin/runtime/node_modules/yargs/CHANGELOG.md +0 -420
- package/plugin/runtime/node_modules/yargs/LICENSE +0 -21
- package/plugin/runtime/node_modules/yargs/README.md +0 -140
- package/plugin/runtime/node_modules/yargs/build/lib/apply-extends.d.ts +0 -2
- package/plugin/runtime/node_modules/yargs/build/lib/apply-extends.js +0 -65
- package/plugin/runtime/node_modules/yargs/build/lib/argsert.d.ts +0 -2
- package/plugin/runtime/node_modules/yargs/build/lib/argsert.js +0 -65
- package/plugin/runtime/node_modules/yargs/build/lib/command.d.ts +0 -64
- package/plugin/runtime/node_modules/yargs/build/lib/command.js +0 -416
- package/plugin/runtime/node_modules/yargs/build/lib/common-types.d.ts +0 -36
- package/plugin/runtime/node_modules/yargs/build/lib/common-types.js +0 -25
- package/plugin/runtime/node_modules/yargs/build/lib/completion-templates.d.ts +0 -2
- package/plugin/runtime/node_modules/yargs/build/lib/completion-templates.js +0 -50
- package/plugin/runtime/node_modules/yargs/build/lib/completion.d.ts +0 -21
- package/plugin/runtime/node_modules/yargs/build/lib/completion.js +0 -135
- package/plugin/runtime/node_modules/yargs/build/lib/is-promise.d.ts +0 -1
- package/plugin/runtime/node_modules/yargs/build/lib/is-promise.js +0 -9
- package/plugin/runtime/node_modules/yargs/build/lib/levenshtein.d.ts +0 -1
- package/plugin/runtime/node_modules/yargs/build/lib/levenshtein.js +0 -58
- package/plugin/runtime/node_modules/yargs/build/lib/middleware.d.ts +0 -10
- package/plugin/runtime/node_modules/yargs/build/lib/middleware.js +0 -57
- package/plugin/runtime/node_modules/yargs/build/lib/obj-filter.d.ts +0 -1
- package/plugin/runtime/node_modules/yargs/build/lib/obj-filter.js +0 -14
- package/plugin/runtime/node_modules/yargs/build/lib/parse-command.d.ts +0 -11
- package/plugin/runtime/node_modules/yargs/build/lib/parse-command.js +0 -36
- package/plugin/runtime/node_modules/yargs/build/lib/process-argv.d.ts +0 -2
- package/plugin/runtime/node_modules/yargs/build/lib/process-argv.js +0 -31
- package/plugin/runtime/node_modules/yargs/build/lib/usage.d.ts +0 -49
- package/plugin/runtime/node_modules/yargs/build/lib/usage.js +0 -540
- package/plugin/runtime/node_modules/yargs/build/lib/validation.d.ts +0 -34
- package/plugin/runtime/node_modules/yargs/build/lib/validation.js +0 -330
- package/plugin/runtime/node_modules/yargs/build/lib/yargs.d.ts +0 -274
- package/plugin/runtime/node_modules/yargs/build/lib/yargs.js +0 -1190
- package/plugin/runtime/node_modules/yargs/build/lib/yerror.d.ts +0 -4
- package/plugin/runtime/node_modules/yargs/build/lib/yerror.js +0 -11
- package/plugin/runtime/node_modules/yargs/index.js +0 -40
- package/plugin/runtime/node_modules/yargs/locales/be.json +0 -46
- package/plugin/runtime/node_modules/yargs/locales/de.json +0 -46
- package/plugin/runtime/node_modules/yargs/locales/en.json +0 -51
- package/plugin/runtime/node_modules/yargs/locales/es.json +0 -46
- package/plugin/runtime/node_modules/yargs/locales/fi.json +0 -49
- package/plugin/runtime/node_modules/yargs/locales/fr.json +0 -53
- package/plugin/runtime/node_modules/yargs/locales/hi.json +0 -49
- package/plugin/runtime/node_modules/yargs/locales/hu.json +0 -46
- package/plugin/runtime/node_modules/yargs/locales/id.json +0 -50
- package/plugin/runtime/node_modules/yargs/locales/it.json +0 -46
- package/plugin/runtime/node_modules/yargs/locales/ja.json +0 -51
- package/plugin/runtime/node_modules/yargs/locales/ko.json +0 -49
- package/plugin/runtime/node_modules/yargs/locales/nb.json +0 -44
- package/plugin/runtime/node_modules/yargs/locales/nl.json +0 -49
- package/plugin/runtime/node_modules/yargs/locales/nn.json +0 -44
- package/plugin/runtime/node_modules/yargs/locales/pirate.json +0 -13
- package/plugin/runtime/node_modules/yargs/locales/pl.json +0 -49
- package/plugin/runtime/node_modules/yargs/locales/pt.json +0 -45
- package/plugin/runtime/node_modules/yargs/locales/pt_BR.json +0 -48
- package/plugin/runtime/node_modules/yargs/locales/ru.json +0 -46
- package/plugin/runtime/node_modules/yargs/locales/th.json +0 -46
- package/plugin/runtime/node_modules/yargs/locales/tr.json +0 -48
- package/plugin/runtime/node_modules/yargs/locales/zh_CN.json +0 -48
- package/plugin/runtime/node_modules/yargs/locales/zh_TW.json +0 -47
- package/plugin/runtime/node_modules/yargs/package.json +0 -92
- package/plugin/runtime/node_modules/yargs/yargs.js +0 -14
- package/plugin/runtime/node_modules/yargs-parser/CHANGELOG.md +0 -601
- package/plugin/runtime/node_modules/yargs-parser/LICENSE.txt +0 -14
- package/plugin/runtime/node_modules/yargs-parser/README.md +0 -449
- package/plugin/runtime/node_modules/yargs-parser/index.js +0 -1032
- package/plugin/runtime/node_modules/yargs-parser/lib/tokenize-arg-string.js +0 -40
- package/plugin/runtime/node_modules/yargs-parser/package.json +0 -46
- package/plugin/runtime/package-lock.json +0 -447
- package/plugin/runtime/package.json +0 -13
|
@@ -1,3773 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Copyright (c) 2014, GMO GlobalSign
|
|
3
|
-
* Copyright (c) 2015-2022, Peculiar Ventures
|
|
4
|
-
* All rights reserved.
|
|
5
|
-
*
|
|
6
|
-
* Author 2014-2019, Yury Strozhevsky
|
|
7
|
-
*
|
|
8
|
-
* Redistribution and use in source and binary forms, with or without modification,
|
|
9
|
-
* are permitted provided that the following conditions are met:
|
|
10
|
-
*
|
|
11
|
-
* * Redistributions of source code must retain the above copyright notice, this
|
|
12
|
-
* list of conditions and the following disclaimer.
|
|
13
|
-
*
|
|
14
|
-
* * Redistributions in binary form must reproduce the above copyright notice, this
|
|
15
|
-
* list of conditions and the following disclaimer in the documentation and/or
|
|
16
|
-
* other materials provided with the distribution.
|
|
17
|
-
*
|
|
18
|
-
* * Neither the name of the copyright holder nor the names of its
|
|
19
|
-
* contributors may be used to endorse or promote products derived from
|
|
20
|
-
* this software without specific prior written permission.
|
|
21
|
-
*
|
|
22
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
23
|
-
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
24
|
-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
25
|
-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
26
|
-
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
27
|
-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
28
|
-
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
29
|
-
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
30
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
31
|
-
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
34
|
-
|
|
35
|
-
'use strict';
|
|
36
|
-
|
|
37
|
-
var pvtsutils = require('pvtsutils');
|
|
38
|
-
var pvutils = require('pvutils');
|
|
39
|
-
|
|
40
|
-
function _interopNamespaceDefault(e) {
|
|
41
|
-
var n = Object.create(null);
|
|
42
|
-
if (e) {
|
|
43
|
-
Object.keys(e).forEach(function (k) {
|
|
44
|
-
if (k !== 'default') {
|
|
45
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
46
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
47
|
-
enumerable: true,
|
|
48
|
-
get: function () { return e[k]; }
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
n.default = e;
|
|
54
|
-
return Object.freeze(n);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
var pvtsutils__namespace = /*#__PURE__*/_interopNamespaceDefault(pvtsutils);
|
|
58
|
-
var pvutils__namespace = /*#__PURE__*/_interopNamespaceDefault(pvutils);
|
|
59
|
-
|
|
60
|
-
function assertBigInt() {
|
|
61
|
-
if (typeof BigInt === "undefined") {
|
|
62
|
-
throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.");
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
function concat(buffers) {
|
|
66
|
-
let outputLength = 0;
|
|
67
|
-
let prevLength = 0;
|
|
68
|
-
for (let i = 0; i < buffers.length; i++) {
|
|
69
|
-
const buffer = buffers[i];
|
|
70
|
-
outputLength += buffer.byteLength;
|
|
71
|
-
}
|
|
72
|
-
const retView = new Uint8Array(outputLength);
|
|
73
|
-
for (let i = 0; i < buffers.length; i++) {
|
|
74
|
-
const buffer = buffers[i];
|
|
75
|
-
retView.set(buffer instanceof Uint8Array ? buffer : new Uint8Array(buffer), prevLength);
|
|
76
|
-
prevLength += buffer.byteLength;
|
|
77
|
-
}
|
|
78
|
-
return retView.buffer;
|
|
79
|
-
}
|
|
80
|
-
function checkBufferParams(baseBlock, inputBuffer, inputOffset, inputLength) {
|
|
81
|
-
if (!(inputBuffer instanceof Uint8Array)) {
|
|
82
|
-
baseBlock.error = "Wrong parameter: inputBuffer must be 'Uint8Array'";
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
if (!inputBuffer.byteLength) {
|
|
86
|
-
baseBlock.error = "Wrong parameter: inputBuffer has zero length";
|
|
87
|
-
return false;
|
|
88
|
-
}
|
|
89
|
-
if (inputOffset < 0) {
|
|
90
|
-
baseBlock.error = "Wrong parameter: inputOffset less than zero";
|
|
91
|
-
return false;
|
|
92
|
-
}
|
|
93
|
-
if (inputLength < 0) {
|
|
94
|
-
baseBlock.error = "Wrong parameter: inputLength less than zero";
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
if (inputBuffer.byteLength - inputOffset - inputLength < 0) {
|
|
98
|
-
baseBlock.error = "End of input reached before message was fully decoded (inconsistent offset and length values)";
|
|
99
|
-
return false;
|
|
100
|
-
}
|
|
101
|
-
return true;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
class ViewWriter {
|
|
105
|
-
constructor() {
|
|
106
|
-
this.items = [];
|
|
107
|
-
}
|
|
108
|
-
write(buf) {
|
|
109
|
-
this.items.push(buf instanceof ArrayBuffer ? buf : concat([buf]));
|
|
110
|
-
}
|
|
111
|
-
final() {
|
|
112
|
-
return concat(this.items);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
const ORIGINAL_VIEW_WRITER_WRITE = ViewWriter.prototype.write;
|
|
116
|
-
const ORIGINAL_VIEW_WRITER_FINAL = ViewWriter.prototype.final;
|
|
117
|
-
|
|
118
|
-
const NAME = "name";
|
|
119
|
-
const VALUE_HEX_VIEW = "valueHexView";
|
|
120
|
-
const IS_HEX_ONLY = "isHexOnly";
|
|
121
|
-
const ID_BLOCK = "idBlock";
|
|
122
|
-
const TAG_CLASS = "tagClass";
|
|
123
|
-
const TAG_NUMBER = "tagNumber";
|
|
124
|
-
const IS_CONSTRUCTED = "isConstructed";
|
|
125
|
-
const FROM_BER = "fromBER";
|
|
126
|
-
const TO_BER = "toBER";
|
|
127
|
-
const LOCAL = "local";
|
|
128
|
-
const EMPTY_STRING = "";
|
|
129
|
-
const EMPTY_BUFFER = new ArrayBuffer(0);
|
|
130
|
-
const EMPTY_VIEW = new Uint8Array(0);
|
|
131
|
-
const END_OF_CONTENT_NAME = "EndOfContent";
|
|
132
|
-
const OCTET_STRING_NAME = "OCTET STRING";
|
|
133
|
-
const BIT_STRING_NAME = "BIT STRING";
|
|
134
|
-
|
|
135
|
-
function HexBlock(BaseClass) {
|
|
136
|
-
var _a;
|
|
137
|
-
return _a = class Some extends BaseClass {
|
|
138
|
-
get valueHex() {
|
|
139
|
-
return this.valueHexView.slice().buffer;
|
|
140
|
-
}
|
|
141
|
-
set valueHex(value) {
|
|
142
|
-
this.valueHexView = new Uint8Array(value);
|
|
143
|
-
}
|
|
144
|
-
constructor(...args) {
|
|
145
|
-
var _b;
|
|
146
|
-
super(...args);
|
|
147
|
-
const params = args[0] || {};
|
|
148
|
-
this.isHexOnly = (_b = params.isHexOnly) !== null && _b !== void 0 ? _b : false;
|
|
149
|
-
this.valueHexView = params.valueHex ? pvtsutils__namespace.BufferSourceConverter.toUint8Array(params.valueHex) : EMPTY_VIEW;
|
|
150
|
-
}
|
|
151
|
-
fromBER(inputBuffer, inputOffset, inputLength, _context) {
|
|
152
|
-
const view = inputBuffer instanceof ArrayBuffer ? new Uint8Array(inputBuffer) : inputBuffer;
|
|
153
|
-
if (!checkBufferParams(this, view, inputOffset, inputLength)) {
|
|
154
|
-
return -1;
|
|
155
|
-
}
|
|
156
|
-
const endLength = inputOffset + inputLength;
|
|
157
|
-
this.valueHexView = view.subarray(inputOffset, endLength);
|
|
158
|
-
if (!this.valueHexView.length) {
|
|
159
|
-
this.warnings.push("Zero buffer length");
|
|
160
|
-
return inputOffset;
|
|
161
|
-
}
|
|
162
|
-
this.blockLength = inputLength;
|
|
163
|
-
return endLength;
|
|
164
|
-
}
|
|
165
|
-
toBER(sizeOnly = false) {
|
|
166
|
-
if (!this.isHexOnly) {
|
|
167
|
-
this.error = "Flag 'isHexOnly' is not set, abort";
|
|
168
|
-
return EMPTY_BUFFER;
|
|
169
|
-
}
|
|
170
|
-
if (sizeOnly) {
|
|
171
|
-
return new ArrayBuffer(this.valueHexView.byteLength);
|
|
172
|
-
}
|
|
173
|
-
if (this.valueHexView.buffer instanceof ArrayBuffer &&
|
|
174
|
-
this.valueHexView.byteLength === this.valueHexView.buffer.byteLength) {
|
|
175
|
-
return this.valueHexView.buffer;
|
|
176
|
-
}
|
|
177
|
-
return pvtsutils__namespace.BufferSourceConverter.toArrayBuffer(this.valueHexView);
|
|
178
|
-
}
|
|
179
|
-
toJSON() {
|
|
180
|
-
return {
|
|
181
|
-
...super.toJSON(),
|
|
182
|
-
isHexOnly: this.isHexOnly,
|
|
183
|
-
valueHex: pvtsutils__namespace.Convert.ToHex(this.valueHexView)
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
},
|
|
187
|
-
_a.NAME = "hexBlock",
|
|
188
|
-
_a;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
class LocalBaseBlock {
|
|
192
|
-
static blockName() {
|
|
193
|
-
return this.NAME;
|
|
194
|
-
}
|
|
195
|
-
get valueBeforeDecode() {
|
|
196
|
-
return this.valueBeforeDecodeView.slice().buffer;
|
|
197
|
-
}
|
|
198
|
-
set valueBeforeDecode(value) {
|
|
199
|
-
this.valueBeforeDecodeView = new Uint8Array(value);
|
|
200
|
-
}
|
|
201
|
-
constructor({ blockLength = 0, error = EMPTY_STRING, warnings = [], valueBeforeDecode = EMPTY_VIEW } = {}) {
|
|
202
|
-
this.blockLength = blockLength;
|
|
203
|
-
this.error = error;
|
|
204
|
-
this.warnings = warnings;
|
|
205
|
-
this.valueBeforeDecodeView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(valueBeforeDecode);
|
|
206
|
-
}
|
|
207
|
-
toJSON() {
|
|
208
|
-
return {
|
|
209
|
-
blockName: this.constructor.NAME,
|
|
210
|
-
blockLength: this.blockLength,
|
|
211
|
-
error: this.error,
|
|
212
|
-
warnings: this.warnings,
|
|
213
|
-
valueBeforeDecode: pvtsutils__namespace.Convert.ToHex(this.valueBeforeDecodeView)
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
LocalBaseBlock.NAME = "baseBlock";
|
|
218
|
-
|
|
219
|
-
class ValueBlock extends LocalBaseBlock {
|
|
220
|
-
fromBER(_inputBuffer, _inputOffset, _inputLength, _context) {
|
|
221
|
-
throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'");
|
|
222
|
-
}
|
|
223
|
-
toBER(_sizeOnly, _writer) {
|
|
224
|
-
throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'");
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
ValueBlock.NAME = "valueBlock";
|
|
228
|
-
|
|
229
|
-
class LocalIdentificationBlock extends HexBlock(LocalBaseBlock) {
|
|
230
|
-
constructor({ idBlock = {} } = {}) {
|
|
231
|
-
var _a, _b, _c, _d;
|
|
232
|
-
super();
|
|
233
|
-
if (idBlock) {
|
|
234
|
-
this.isHexOnly = (_a = idBlock.isHexOnly) !== null && _a !== void 0 ? _a : false;
|
|
235
|
-
this.valueHexView = idBlock.valueHex
|
|
236
|
-
? pvtsutils__namespace.BufferSourceConverter.toUint8Array(idBlock.valueHex)
|
|
237
|
-
: EMPTY_VIEW;
|
|
238
|
-
this.tagClass = (_b = idBlock.tagClass) !== null && _b !== void 0 ? _b : -1;
|
|
239
|
-
this.tagNumber = (_c = idBlock.tagNumber) !== null && _c !== void 0 ? _c : -1;
|
|
240
|
-
this.isConstructed = (_d = idBlock.isConstructed) !== null && _d !== void 0 ? _d : false;
|
|
241
|
-
}
|
|
242
|
-
else {
|
|
243
|
-
this.tagClass = -1;
|
|
244
|
-
this.tagNumber = -1;
|
|
245
|
-
this.isConstructed = false;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
toBER(sizeOnly = false) {
|
|
249
|
-
let firstOctet = 0;
|
|
250
|
-
switch (this.tagClass) {
|
|
251
|
-
case 1:
|
|
252
|
-
firstOctet |= 0x00;
|
|
253
|
-
break;
|
|
254
|
-
case 2:
|
|
255
|
-
firstOctet |= 0x40;
|
|
256
|
-
break;
|
|
257
|
-
case 3:
|
|
258
|
-
firstOctet |= 0x80;
|
|
259
|
-
break;
|
|
260
|
-
case 4:
|
|
261
|
-
firstOctet |= 0xc0;
|
|
262
|
-
break;
|
|
263
|
-
default:
|
|
264
|
-
this.error = "Unknown tag class";
|
|
265
|
-
return EMPTY_BUFFER;
|
|
266
|
-
}
|
|
267
|
-
if (this.isConstructed)
|
|
268
|
-
firstOctet |= 0x20;
|
|
269
|
-
if (this.tagNumber < 31 && !this.isHexOnly) {
|
|
270
|
-
const retView = new Uint8Array(1);
|
|
271
|
-
if (!sizeOnly) {
|
|
272
|
-
let number = this.tagNumber;
|
|
273
|
-
number &= 0x1f;
|
|
274
|
-
firstOctet |= number;
|
|
275
|
-
retView[0] = firstOctet;
|
|
276
|
-
}
|
|
277
|
-
return retView.buffer;
|
|
278
|
-
}
|
|
279
|
-
if (!this.isHexOnly) {
|
|
280
|
-
const encodedBuf = pvutils__namespace.utilToBase(this.tagNumber, 7);
|
|
281
|
-
const encodedView = new Uint8Array(encodedBuf);
|
|
282
|
-
const size = encodedBuf.byteLength;
|
|
283
|
-
const retView = new Uint8Array(size + 1);
|
|
284
|
-
retView[0] = firstOctet | 0x1f;
|
|
285
|
-
if (!sizeOnly) {
|
|
286
|
-
for (let i = 0; i < size - 1; i++)
|
|
287
|
-
retView[i + 1] = encodedView[i] | 0x80;
|
|
288
|
-
retView[size] = encodedView[size - 1];
|
|
289
|
-
}
|
|
290
|
-
return retView.buffer;
|
|
291
|
-
}
|
|
292
|
-
const retView = new Uint8Array(this.valueHexView.byteLength + 1);
|
|
293
|
-
retView[0] = firstOctet | 0x1f;
|
|
294
|
-
if (!sizeOnly) {
|
|
295
|
-
const curView = this.valueHexView;
|
|
296
|
-
for (let i = 0; i < curView.length - 1; i++)
|
|
297
|
-
retView[i + 1] = curView[i] | 0x80;
|
|
298
|
-
retView[this.valueHexView.byteLength] = curView[curView.length - 1];
|
|
299
|
-
}
|
|
300
|
-
return retView.buffer;
|
|
301
|
-
}
|
|
302
|
-
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
303
|
-
const inputView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
304
|
-
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
305
|
-
return -1;
|
|
306
|
-
}
|
|
307
|
-
const fastArgs = Number.isInteger(inputOffset) && Number.isInteger(inputLength);
|
|
308
|
-
const intBuffer = fastArgs ? inputView : inputView.subarray(inputOffset, inputOffset + inputLength);
|
|
309
|
-
const baseIndex = fastArgs ? inputOffset : 0;
|
|
310
|
-
const bufferLength = fastArgs ? inputLength : intBuffer.length;
|
|
311
|
-
if (bufferLength === 0) {
|
|
312
|
-
this.error = "Zero buffer length";
|
|
313
|
-
return -1;
|
|
314
|
-
}
|
|
315
|
-
const tagClassMask = intBuffer[baseIndex] & 0xc0;
|
|
316
|
-
switch (tagClassMask) {
|
|
317
|
-
case 0x00:
|
|
318
|
-
this.tagClass = 1;
|
|
319
|
-
break;
|
|
320
|
-
case 0x40:
|
|
321
|
-
this.tagClass = 2;
|
|
322
|
-
break;
|
|
323
|
-
case 0x80:
|
|
324
|
-
this.tagClass = 3;
|
|
325
|
-
break;
|
|
326
|
-
case 0xc0:
|
|
327
|
-
this.tagClass = 4;
|
|
328
|
-
break;
|
|
329
|
-
default:
|
|
330
|
-
this.error = "Unknown tag class";
|
|
331
|
-
return -1;
|
|
332
|
-
}
|
|
333
|
-
this.isConstructed = (intBuffer[baseIndex] & 0x20) === 0x20;
|
|
334
|
-
this.isHexOnly = false;
|
|
335
|
-
const tagNumberMask = intBuffer[baseIndex] & 0x1f;
|
|
336
|
-
if (tagNumberMask !== 0x1f) {
|
|
337
|
-
this.tagNumber = tagNumberMask;
|
|
338
|
-
this.blockLength = 1;
|
|
339
|
-
}
|
|
340
|
-
else {
|
|
341
|
-
let count = 0;
|
|
342
|
-
while (true) {
|
|
343
|
-
const tagByteIndex = count + 1;
|
|
344
|
-
if (tagByteIndex >= bufferLength) {
|
|
345
|
-
this.error = "End of input reached before message was fully decoded";
|
|
346
|
-
return -1;
|
|
347
|
-
}
|
|
348
|
-
count++;
|
|
349
|
-
if ((intBuffer[baseIndex + tagByteIndex] & 0x80) === 0x00)
|
|
350
|
-
break;
|
|
351
|
-
}
|
|
352
|
-
this.blockLength = count + 1;
|
|
353
|
-
const intTagNumberBuffer = (this.valueHexView = new Uint8Array(count));
|
|
354
|
-
for (let i = 0; i < count; i++)
|
|
355
|
-
intTagNumberBuffer[i] = intBuffer[baseIndex + i + 1] & 0x7f;
|
|
356
|
-
if (this.blockLength <= 9)
|
|
357
|
-
this.tagNumber = pvutils__namespace.utilFromBase(intTagNumberBuffer, 7);
|
|
358
|
-
else {
|
|
359
|
-
this.isHexOnly = true;
|
|
360
|
-
this.warnings.push("Tag too long, represented as hex-coded");
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
if (this.tagClass === 1 && this.isConstructed) {
|
|
364
|
-
switch (this.tagNumber) {
|
|
365
|
-
case 1:
|
|
366
|
-
case 2:
|
|
367
|
-
case 5:
|
|
368
|
-
case 6:
|
|
369
|
-
case 9:
|
|
370
|
-
case 13:
|
|
371
|
-
case 14:
|
|
372
|
-
case 23:
|
|
373
|
-
case 24:
|
|
374
|
-
case 31:
|
|
375
|
-
case 32:
|
|
376
|
-
case 33:
|
|
377
|
-
case 34:
|
|
378
|
-
this.error = "Constructed encoding used for primitive type";
|
|
379
|
-
return -1;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
return inputOffset + this.blockLength;
|
|
383
|
-
}
|
|
384
|
-
toJSON() {
|
|
385
|
-
return {
|
|
386
|
-
...super.toJSON(),
|
|
387
|
-
tagClass: this.tagClass,
|
|
388
|
-
tagNumber: this.tagNumber,
|
|
389
|
-
isConstructed: this.isConstructed
|
|
390
|
-
};
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
LocalIdentificationBlock.NAME = "identificationBlock";
|
|
394
|
-
const ORIGINAL_LOCAL_IDENTIFICATION_TO_BER = LocalIdentificationBlock.prototype.toBER;
|
|
395
|
-
const ORIGINAL_LOCAL_IDENTIFICATION_FROM_BER = LocalIdentificationBlock.prototype.fromBER;
|
|
396
|
-
|
|
397
|
-
class LocalLengthBlock extends LocalBaseBlock {
|
|
398
|
-
constructor({ lenBlock = {} } = {}) {
|
|
399
|
-
var _a, _b, _c;
|
|
400
|
-
super();
|
|
401
|
-
this.isIndefiniteForm = (_a = lenBlock.isIndefiniteForm) !== null && _a !== void 0 ? _a : false;
|
|
402
|
-
this.longFormUsed = (_b = lenBlock.longFormUsed) !== null && _b !== void 0 ? _b : false;
|
|
403
|
-
this.length = (_c = lenBlock.length) !== null && _c !== void 0 ? _c : 0;
|
|
404
|
-
}
|
|
405
|
-
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
406
|
-
const view = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
407
|
-
if (!checkBufferParams(this, view, inputOffset, inputLength)) {
|
|
408
|
-
return -1;
|
|
409
|
-
}
|
|
410
|
-
const fastArgs = Number.isInteger(inputOffset) && Number.isInteger(inputLength);
|
|
411
|
-
const intBuffer = fastArgs ? view : view.subarray(inputOffset, inputOffset + inputLength);
|
|
412
|
-
const baseIndex = fastArgs ? inputOffset : 0;
|
|
413
|
-
const bufferLength = fastArgs ? inputLength : intBuffer.length;
|
|
414
|
-
if (bufferLength === 0) {
|
|
415
|
-
this.error = "Zero buffer length";
|
|
416
|
-
return -1;
|
|
417
|
-
}
|
|
418
|
-
if (intBuffer[baseIndex] === 0xff) {
|
|
419
|
-
this.error = "Length block 0xFF is reserved by standard";
|
|
420
|
-
return -1;
|
|
421
|
-
}
|
|
422
|
-
this.isIndefiniteForm = intBuffer[baseIndex] === 0x80;
|
|
423
|
-
if (this.isIndefiniteForm) {
|
|
424
|
-
this.blockLength = 1;
|
|
425
|
-
return inputOffset + this.blockLength;
|
|
426
|
-
}
|
|
427
|
-
this.longFormUsed = !!(intBuffer[baseIndex] & 0x80);
|
|
428
|
-
if (this.longFormUsed === false) {
|
|
429
|
-
this.length = intBuffer[baseIndex];
|
|
430
|
-
this.blockLength = 1;
|
|
431
|
-
return inputOffset + this.blockLength;
|
|
432
|
-
}
|
|
433
|
-
const count = intBuffer[baseIndex] & 0x7f;
|
|
434
|
-
if (count > 8) {
|
|
435
|
-
this.error = "Too big integer";
|
|
436
|
-
return -1;
|
|
437
|
-
}
|
|
438
|
-
if (count + 1 > bufferLength) {
|
|
439
|
-
this.error = "End of input reached before message was fully decoded";
|
|
440
|
-
return -1;
|
|
441
|
-
}
|
|
442
|
-
const lenOffset = inputOffset + 1;
|
|
443
|
-
const lengthBufferView = view.subarray(lenOffset, lenOffset + count);
|
|
444
|
-
if (lengthBufferView[count - 1] === 0x00)
|
|
445
|
-
this.warnings.push("Needlessly long encoded length");
|
|
446
|
-
this.length = pvutils__namespace.utilFromBase(lengthBufferView, 8);
|
|
447
|
-
if (this.longFormUsed && this.length <= 127)
|
|
448
|
-
this.warnings.push("Unnecessary usage of long length form");
|
|
449
|
-
this.blockLength = count + 1;
|
|
450
|
-
return inputOffset + this.blockLength;
|
|
451
|
-
}
|
|
452
|
-
toBER(sizeOnly = false) {
|
|
453
|
-
let retBuf;
|
|
454
|
-
let retView;
|
|
455
|
-
if (this.length > 127)
|
|
456
|
-
this.longFormUsed = true;
|
|
457
|
-
if (this.isIndefiniteForm) {
|
|
458
|
-
retBuf = new ArrayBuffer(1);
|
|
459
|
-
if (sizeOnly === false) {
|
|
460
|
-
retView = new Uint8Array(retBuf);
|
|
461
|
-
retView[0] = 0x80;
|
|
462
|
-
}
|
|
463
|
-
return retBuf;
|
|
464
|
-
}
|
|
465
|
-
if (this.longFormUsed) {
|
|
466
|
-
const encodedBuf = pvutils__namespace.utilToBase(this.length, 8);
|
|
467
|
-
if (encodedBuf.byteLength > 127) {
|
|
468
|
-
this.error = "Too big length";
|
|
469
|
-
return EMPTY_BUFFER;
|
|
470
|
-
}
|
|
471
|
-
retBuf = new ArrayBuffer(encodedBuf.byteLength + 1);
|
|
472
|
-
if (sizeOnly)
|
|
473
|
-
return retBuf;
|
|
474
|
-
const encodedView = new Uint8Array(encodedBuf);
|
|
475
|
-
retView = new Uint8Array(retBuf);
|
|
476
|
-
retView[0] = encodedBuf.byteLength | 0x80;
|
|
477
|
-
for (let i = 0; i < encodedBuf.byteLength; i++)
|
|
478
|
-
retView[i + 1] = encodedView[i];
|
|
479
|
-
return retBuf;
|
|
480
|
-
}
|
|
481
|
-
retBuf = new ArrayBuffer(1);
|
|
482
|
-
if (sizeOnly === false) {
|
|
483
|
-
retView = new Uint8Array(retBuf);
|
|
484
|
-
retView[0] = this.length;
|
|
485
|
-
}
|
|
486
|
-
return retBuf;
|
|
487
|
-
}
|
|
488
|
-
toJSON() {
|
|
489
|
-
return {
|
|
490
|
-
...super.toJSON(),
|
|
491
|
-
isIndefiniteForm: this.isIndefiniteForm,
|
|
492
|
-
longFormUsed: this.longFormUsed,
|
|
493
|
-
length: this.length
|
|
494
|
-
};
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
LocalLengthBlock.NAME = "lengthBlock";
|
|
498
|
-
const ORIGINAL_LOCAL_LENGTH_TO_BER = LocalLengthBlock.prototype.toBER;
|
|
499
|
-
const ORIGINAL_LOCAL_LENGTH_FROM_BER = LocalLengthBlock.prototype.fromBER;
|
|
500
|
-
|
|
501
|
-
const typeStore = {};
|
|
502
|
-
|
|
503
|
-
var _a$y, _b, _c;
|
|
504
|
-
const originalUint8ArraySliceInfo = findMethod(Uint8Array.prototype, "slice");
|
|
505
|
-
const originalUint8ArrayConstructor = (_a$y = Object.getOwnPropertyDescriptor(Uint8Array.prototype, "constructor")) === null || _a$y === void 0 ? void 0 : _a$y.value;
|
|
506
|
-
const originalArrayIterator = (_b = Object.getOwnPropertyDescriptor(Array.prototype, Symbol.iterator)) === null || _b === void 0 ? void 0 : _b.value;
|
|
507
|
-
const intrinsicTypedArrayByteLength = (_c = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Uint8Array.prototype), "byteLength")) === null || _c === void 0 ? void 0 : _c.get;
|
|
508
|
-
const BUILTIN_DISPATCH_PAYLOAD_THRESHOLD = 16384;
|
|
509
|
-
const BUILTIN_DISPATCH_MAX_DEPTH = 64;
|
|
510
|
-
let builtinRegistry;
|
|
511
|
-
function registerBuiltinEncoder(builtinConstructors, internals) {
|
|
512
|
-
const current = builtinRegistry;
|
|
513
|
-
const nextInternals = internals || current;
|
|
514
|
-
if (!nextInternals) {
|
|
515
|
-
builtinRegistry = undefined;
|
|
516
|
-
return;
|
|
517
|
-
}
|
|
518
|
-
builtinRegistry = { ...nextInternals, ...builtinConstructors };
|
|
519
|
-
}
|
|
520
|
-
function dataProperty(object, name) {
|
|
521
|
-
const descriptor = Object.getOwnPropertyDescriptor(object, name);
|
|
522
|
-
if (!descriptor || !("value" in descriptor))
|
|
523
|
-
return undefined;
|
|
524
|
-
return descriptor.value;
|
|
525
|
-
}
|
|
526
|
-
function intrinsicPayloadByteLength(value) {
|
|
527
|
-
if (!intrinsicTypedArrayByteLength || !value || typeof value !== "object")
|
|
528
|
-
return undefined;
|
|
529
|
-
try {
|
|
530
|
-
const byteLength = intrinsicTypedArrayByteLength.call(value);
|
|
531
|
-
return typeof byteLength === "number" ? byteLength : undefined;
|
|
532
|
-
}
|
|
533
|
-
catch {
|
|
534
|
-
return undefined;
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
function largePayloadOrChain(block, depth) {
|
|
538
|
-
if (depth > BUILTIN_DISPATCH_MAX_DEPTH || !block || typeof block !== "object")
|
|
539
|
-
return false;
|
|
540
|
-
const valueBlockDescriptor = Object.getOwnPropertyDescriptor(block, "valueBlock");
|
|
541
|
-
if (!valueBlockDescriptor || !("value" in valueBlockDescriptor))
|
|
542
|
-
return false;
|
|
543
|
-
const valueBlock = valueBlockDescriptor.value;
|
|
544
|
-
if (!valueBlock || typeof valueBlock !== "object")
|
|
545
|
-
return false;
|
|
546
|
-
const payloadDescriptor = Object.getOwnPropertyDescriptor(valueBlock, "valueHexView");
|
|
547
|
-
if (payloadDescriptor) {
|
|
548
|
-
if (!("value" in payloadDescriptor))
|
|
549
|
-
return false;
|
|
550
|
-
const byteLength = intrinsicPayloadByteLength(payloadDescriptor.value);
|
|
551
|
-
return byteLength !== undefined && byteLength >= BUILTIN_DISPATCH_PAYLOAD_THRESHOLD;
|
|
552
|
-
}
|
|
553
|
-
const valuesDescriptor = Object.getOwnPropertyDescriptor(valueBlock, "value");
|
|
554
|
-
if (!valuesDescriptor || !("value" in valuesDescriptor) || !Array.isArray(valuesDescriptor.value))
|
|
555
|
-
return false;
|
|
556
|
-
const values = valuesDescriptor.value;
|
|
557
|
-
const lengthDescriptor = Object.getOwnPropertyDescriptor(values, "length");
|
|
558
|
-
if (!lengthDescriptor || !("value" in lengthDescriptor) || lengthDescriptor.value !== 1)
|
|
559
|
-
return false;
|
|
560
|
-
const indexDescriptor = Object.getOwnPropertyDescriptor(values, "0");
|
|
561
|
-
if (!indexDescriptor || !("value" in indexDescriptor))
|
|
562
|
-
return false;
|
|
563
|
-
return largePayloadOrChain(indexDescriptor.value, depth + 1);
|
|
564
|
-
}
|
|
565
|
-
function shouldUseBuiltinEncoder(block) {
|
|
566
|
-
try {
|
|
567
|
-
return largePayloadOrChain(block, 0);
|
|
568
|
-
}
|
|
569
|
-
catch {
|
|
570
|
-
return false;
|
|
571
|
-
}
|
|
572
|
-
}
|
|
573
|
-
function sameDataMethod(current, original) {
|
|
574
|
-
return (!!current &&
|
|
575
|
-
"value" in current &&
|
|
576
|
-
current.value === original &&
|
|
577
|
-
current.writable === true &&
|
|
578
|
-
current.enumerable === false &&
|
|
579
|
-
current.configurable === true);
|
|
580
|
-
}
|
|
581
|
-
function writerMethodsStable(registry) {
|
|
582
|
-
return (sameDataMethod(Object.getOwnPropertyDescriptor(registry.ViewWriter.prototype, "write"), registry.originalWriterWrite) &&
|
|
583
|
-
sameDataMethod(Object.getOwnPropertyDescriptor(registry.ViewWriter.prototype, "final"), registry.originalWriterFinal));
|
|
584
|
-
}
|
|
585
|
-
function findMethod(prototype, name) {
|
|
586
|
-
let current = prototype;
|
|
587
|
-
while (current) {
|
|
588
|
-
const descriptor = Object.getOwnPropertyDescriptor(current, name);
|
|
589
|
-
if (descriptor) {
|
|
590
|
-
if ("value" in descriptor && typeof descriptor.value === "function") {
|
|
591
|
-
return { declaringPrototype: current, method: descriptor.value };
|
|
592
|
-
}
|
|
593
|
-
return undefined;
|
|
594
|
-
}
|
|
595
|
-
current = Object.getPrototypeOf(current);
|
|
596
|
-
}
|
|
597
|
-
return undefined;
|
|
598
|
-
}
|
|
599
|
-
function stableInheritedMethod(prototype, name, original) {
|
|
600
|
-
if (!original)
|
|
601
|
-
return false;
|
|
602
|
-
let current = prototype;
|
|
603
|
-
while (current) {
|
|
604
|
-
const descriptor = Object.getOwnPropertyDescriptor(current, name);
|
|
605
|
-
if (current === original.declaringPrototype) {
|
|
606
|
-
return !!descriptor && "value" in descriptor && descriptor.value === original.method;
|
|
607
|
-
}
|
|
608
|
-
if (descriptor)
|
|
609
|
-
return false;
|
|
610
|
-
current = Object.getPrototypeOf(current);
|
|
611
|
-
}
|
|
612
|
-
return false;
|
|
613
|
-
}
|
|
614
|
-
function prototypeMethod(object, prototype, name, expected) {
|
|
615
|
-
if (Object.prototype.hasOwnProperty.call(object, name))
|
|
616
|
-
return false;
|
|
617
|
-
if (Object.getPrototypeOf(object) !== prototype)
|
|
618
|
-
return false;
|
|
619
|
-
const descriptor = Object.getOwnPropertyDescriptor(prototype, name);
|
|
620
|
-
return !!descriptor && "value" in descriptor && descriptor.value === expected;
|
|
621
|
-
}
|
|
622
|
-
function inheritedMethod(object, name, expected, primitiveConstructor) {
|
|
623
|
-
if (Object.prototype.hasOwnProperty.call(object, name))
|
|
624
|
-
return false;
|
|
625
|
-
const prototype = Object.getPrototypeOf(object);
|
|
626
|
-
const originalPrimitiveValuePrototype = Object.getPrototypeOf(primitiveConstructor.prototype);
|
|
627
|
-
if (prototype !== primitiveConstructor.prototype ||
|
|
628
|
-
Object.getPrototypeOf(prototype) !== originalPrimitiveValuePrototype) {
|
|
629
|
-
return false;
|
|
630
|
-
}
|
|
631
|
-
const descriptor = prototype && Object.getOwnPropertyDescriptor(prototype, name);
|
|
632
|
-
if (descriptor)
|
|
633
|
-
return false;
|
|
634
|
-
const parentDescriptor = Object.getOwnPropertyDescriptor(originalPrimitiveValuePrototype, name);
|
|
635
|
-
return !!parentDescriptor && "value" in parentDescriptor && parentDescriptor.value === expected;
|
|
636
|
-
}
|
|
637
|
-
function plainPayload(value, allowEmpty = false) {
|
|
638
|
-
if (!(value instanceof Uint8Array) || Object.getPrototypeOf(value) !== Uint8Array.prototype)
|
|
639
|
-
return undefined;
|
|
640
|
-
for (const name of ["buffer", "byteOffset", "byteLength", "length", "slice", "constructor"]) {
|
|
641
|
-
if (Object.prototype.hasOwnProperty.call(value, name))
|
|
642
|
-
return undefined;
|
|
643
|
-
}
|
|
644
|
-
const constructorDescriptor = Object.getOwnPropertyDescriptor(Uint8Array.prototype, "constructor");
|
|
645
|
-
if (!constructorDescriptor ||
|
|
646
|
-
!("value" in constructorDescriptor) ||
|
|
647
|
-
constructorDescriptor.value !== originalUint8ArrayConstructor)
|
|
648
|
-
return undefined;
|
|
649
|
-
if (!stableInheritedMethod(Uint8Array.prototype, "slice", originalUint8ArraySliceInfo))
|
|
650
|
-
return undefined;
|
|
651
|
-
try {
|
|
652
|
-
const buffer = value.buffer;
|
|
653
|
-
if (!(buffer instanceof ArrayBuffer) || Object.getPrototypeOf(buffer) !== ArrayBuffer.prototype)
|
|
654
|
-
return undefined;
|
|
655
|
-
if (Object.prototype.hasOwnProperty.call(buffer, "byteLength"))
|
|
656
|
-
return undefined;
|
|
657
|
-
if (value.byteLength !== value.length || (!allowEmpty && value.byteLength === 0))
|
|
658
|
-
return undefined;
|
|
659
|
-
if (value.byteOffset < 0 || value.byteOffset + value.byteLength > buffer.byteLength)
|
|
660
|
-
return undefined;
|
|
661
|
-
}
|
|
662
|
-
catch {
|
|
663
|
-
return undefined;
|
|
664
|
-
}
|
|
665
|
-
return value;
|
|
666
|
-
}
|
|
667
|
-
function validIdBlock(block, constructed, registry) {
|
|
668
|
-
if (Object.getPrototypeOf(block) !== registry.LocalIdentificationBlock.prototype)
|
|
669
|
-
return false;
|
|
670
|
-
if (!prototypeMethod(block, registry.LocalIdentificationBlock.prototype, "toBER", registry.originalIdentificationToBER))
|
|
671
|
-
return false;
|
|
672
|
-
const tagClass = dataProperty(block, "tagClass");
|
|
673
|
-
const tagNumber = dataProperty(block, "tagNumber");
|
|
674
|
-
const isConstructed = dataProperty(block, "isConstructed");
|
|
675
|
-
const isHexOnly = dataProperty(block, "isHexOnly");
|
|
676
|
-
const valueHexView = dataProperty(block, "valueHexView");
|
|
677
|
-
if (typeof tagClass !== "number" || !Number.isInteger(tagClass) || tagClass < 1 || tagClass > 4)
|
|
678
|
-
return false;
|
|
679
|
-
if (typeof tagNumber !== "number" || !Number.isInteger(tagNumber) || tagNumber < 0)
|
|
680
|
-
return false;
|
|
681
|
-
if (isConstructed !== constructed || typeof isHexOnly !== "boolean")
|
|
682
|
-
return false;
|
|
683
|
-
if (isHexOnly)
|
|
684
|
-
return !!plainPayload(valueHexView);
|
|
685
|
-
return Number.isSafeInteger(tagNumber);
|
|
686
|
-
}
|
|
687
|
-
function validLengthBlock(block, allowIndefinite, registry) {
|
|
688
|
-
if (Object.getPrototypeOf(block) !== registry.LocalLengthBlock.prototype)
|
|
689
|
-
return false;
|
|
690
|
-
if (!prototypeMethod(block, registry.LocalLengthBlock.prototype, "toBER", registry.originalLengthToBER))
|
|
691
|
-
return false;
|
|
692
|
-
const indefinite = dataProperty(block, "isIndefiniteForm");
|
|
693
|
-
const longForm = dataProperty(block, "longFormUsed");
|
|
694
|
-
const lengthDescriptor = Object.getOwnPropertyDescriptor(block, "length");
|
|
695
|
-
const length = lengthDescriptor && "value" in lengthDescriptor ? lengthDescriptor.value : undefined;
|
|
696
|
-
const longFormDescriptor = Object.getOwnPropertyDescriptor(block, "longFormUsed");
|
|
697
|
-
return (typeof indefinite === "boolean" &&
|
|
698
|
-
(indefinite === false || allowIndefinite) &&
|
|
699
|
-
typeof longForm === "boolean" &&
|
|
700
|
-
!!longFormDescriptor &&
|
|
701
|
-
"value" in longFormDescriptor &&
|
|
702
|
-
longFormDescriptor.writable === true &&
|
|
703
|
-
!!lengthDescriptor &&
|
|
704
|
-
"value" in lengthDescriptor &&
|
|
705
|
-
lengthDescriptor.writable === true &&
|
|
706
|
-
typeof length === "number" &&
|
|
707
|
-
Number.isSafeInteger(length) &&
|
|
708
|
-
length >= 0);
|
|
709
|
-
}
|
|
710
|
-
function validBaseBlock(block, isConstructed, registry) {
|
|
711
|
-
const idBlock = dataProperty(block, "idBlock");
|
|
712
|
-
const lenBlock = dataProperty(block, "lenBlock");
|
|
713
|
-
return (!!idBlock &&
|
|
714
|
-
!!lenBlock &&
|
|
715
|
-
validIdBlock(idBlock, isConstructed, registry) &&
|
|
716
|
-
validLengthBlock(lenBlock, isConstructed, registry));
|
|
717
|
-
}
|
|
718
|
-
function constructedChild(block, registry) {
|
|
719
|
-
const valueBlock = dataProperty(block, "valueBlock");
|
|
720
|
-
if (!valueBlock || Object.getPrototypeOf(valueBlock) !== registry.LocalConstructedValueBlock.prototype)
|
|
721
|
-
return undefined;
|
|
722
|
-
if (!prototypeMethod(valueBlock, registry.LocalConstructedValueBlock.prototype, "toBER", registry.originalConstructedToBER))
|
|
723
|
-
return undefined;
|
|
724
|
-
const values = dataProperty(valueBlock, "value");
|
|
725
|
-
if (!Array.isArray(values) || Object.getPrototypeOf(values) !== Array.prototype)
|
|
726
|
-
return undefined;
|
|
727
|
-
const lengthDescriptor = Object.getOwnPropertyDescriptor(values, "length");
|
|
728
|
-
if (!lengthDescriptor || !("value" in lengthDescriptor) || lengthDescriptor.value !== 1)
|
|
729
|
-
return undefined;
|
|
730
|
-
if (Object.prototype.hasOwnProperty.call(values, Symbol.iterator))
|
|
731
|
-
return undefined;
|
|
732
|
-
const iteratorDescriptor = Object.getOwnPropertyDescriptor(Array.prototype, Symbol.iterator);
|
|
733
|
-
if (!iteratorDescriptor || !("value" in iteratorDescriptor) || iteratorDescriptor.value !== originalArrayIterator)
|
|
734
|
-
return undefined;
|
|
735
|
-
const indexDescriptor = Object.getOwnPropertyDescriptor(values, "0");
|
|
736
|
-
if (!indexDescriptor || !("value" in indexDescriptor))
|
|
737
|
-
return undefined;
|
|
738
|
-
if (Object.getOwnPropertyNames(values).length !== 2)
|
|
739
|
-
return undefined;
|
|
740
|
-
return indexDescriptor.value;
|
|
741
|
-
}
|
|
742
|
-
function bitPayload(block, registry) {
|
|
743
|
-
const valueBlock = dataProperty(block, "valueBlock");
|
|
744
|
-
if (!valueBlock || Object.getPrototypeOf(valueBlock) !== registry.LocalBitStringValueBlock.prototype)
|
|
745
|
-
return undefined;
|
|
746
|
-
if (!prototypeMethod(valueBlock, registry.LocalBitStringValueBlock.prototype, "toBER", registry.originalBitStringToBER))
|
|
747
|
-
return undefined;
|
|
748
|
-
if (dataProperty(valueBlock, "isConstructed") !== false)
|
|
749
|
-
return undefined;
|
|
750
|
-
const unusedBits = dataProperty(valueBlock, "unusedBits");
|
|
751
|
-
if (typeof unusedBits !== "number" || !Number.isInteger(unusedBits) || unusedBits < 0 || unusedBits > 7)
|
|
752
|
-
return undefined;
|
|
753
|
-
const payload = plainPayload(dataProperty(valueBlock, "valueHexView"), true);
|
|
754
|
-
if (!payload)
|
|
755
|
-
return undefined;
|
|
756
|
-
return { payload, prefix: Uint8Array.of(payload.byteLength ? unusedBits : 0) };
|
|
757
|
-
}
|
|
758
|
-
function primitivePayload(block, kind, registry) {
|
|
759
|
-
const valueBlock = dataProperty(block, "valueBlock");
|
|
760
|
-
if (!valueBlock)
|
|
761
|
-
return undefined;
|
|
762
|
-
if (kind === "integer") {
|
|
763
|
-
if (Object.getPrototypeOf(valueBlock) !== registry.LocalIntegerValueBlock.prototype)
|
|
764
|
-
return undefined;
|
|
765
|
-
if (!prototypeMethod(valueBlock, registry.LocalIntegerValueBlock.prototype, "toBER", registry.originalIntegerToBER))
|
|
766
|
-
return undefined;
|
|
767
|
-
}
|
|
768
|
-
else if (kind === "octet") {
|
|
769
|
-
if (Object.getPrototypeOf(valueBlock) !== registry.LocalOctetStringValueBlock.prototype)
|
|
770
|
-
return undefined;
|
|
771
|
-
if (!prototypeMethod(valueBlock, registry.LocalOctetStringValueBlock.prototype, "toBER", registry.originalOctetStringToBER))
|
|
772
|
-
return undefined;
|
|
773
|
-
if (dataProperty(valueBlock, "isConstructed") !== false)
|
|
774
|
-
return undefined;
|
|
775
|
-
}
|
|
776
|
-
else {
|
|
777
|
-
if (Object.getPrototypeOf(valueBlock) !== registry.LocalPrimitiveValueBlock.prototype)
|
|
778
|
-
return undefined;
|
|
779
|
-
if (!inheritedMethod(valueBlock, "toBER", registry.originalPrimitiveToBER, registry.LocalPrimitiveValueBlock))
|
|
780
|
-
return undefined;
|
|
781
|
-
}
|
|
782
|
-
if (kind === "primitive" && dataProperty(valueBlock, "isHexOnly") !== true)
|
|
783
|
-
return undefined;
|
|
784
|
-
if (typeof dataProperty(valueBlock, "isHexOnly") !== "boolean")
|
|
785
|
-
return undefined;
|
|
786
|
-
return plainPayload(dataProperty(valueBlock, "valueHexView"));
|
|
787
|
-
}
|
|
788
|
-
function validOuterMethod(block, registry) {
|
|
789
|
-
if (Object.prototype.hasOwnProperty.call(block, "toBER"))
|
|
790
|
-
return false;
|
|
791
|
-
let prototype = block;
|
|
792
|
-
while (prototype) {
|
|
793
|
-
const descriptor = Object.getOwnPropertyDescriptor(prototype, "toBER");
|
|
794
|
-
if (descriptor)
|
|
795
|
-
return "value" in descriptor && descriptor.value === registry.originalBaseBlockToBER;
|
|
796
|
-
prototype = Object.getPrototypeOf(prototype);
|
|
797
|
-
}
|
|
798
|
-
return false;
|
|
799
|
-
}
|
|
800
|
-
function isPrimitive(block, type, registry) {
|
|
801
|
-
const constructor = registry[type];
|
|
802
|
-
return !!constructor && Object.getPrototypeOf(block) === constructor.prototype;
|
|
803
|
-
}
|
|
804
|
-
function isConstructed(block, registry) {
|
|
805
|
-
return (Object.getPrototypeOf(block) === registry.Sequence.prototype ||
|
|
806
|
-
Object.getPrototypeOf(block) === registry.Set.prototype ||
|
|
807
|
-
Object.getPrototypeOf(block) === registry.Constructed.prototype);
|
|
808
|
-
}
|
|
809
|
-
function inspectNode(block, depth, registry) {
|
|
810
|
-
if (depth > BUILTIN_DISPATCH_MAX_DEPTH || !block || typeof block !== "object")
|
|
811
|
-
return undefined;
|
|
812
|
-
try {
|
|
813
|
-
if (!validOuterMethod(block, registry))
|
|
814
|
-
return undefined;
|
|
815
|
-
const primitiveKind = isPrimitive(block, "BitString", registry)
|
|
816
|
-
? "bit"
|
|
817
|
-
: isPrimitive(block, "Integer", registry)
|
|
818
|
-
? "integer"
|
|
819
|
-
: isPrimitive(block, "OctetString", registry)
|
|
820
|
-
? "octet"
|
|
821
|
-
: isPrimitive(block, "Primitive", registry)
|
|
822
|
-
? "primitive"
|
|
823
|
-
: undefined;
|
|
824
|
-
const constructed = primitiveKind === undefined && isConstructed(block, registry);
|
|
825
|
-
if (!primitiveKind && !constructed)
|
|
826
|
-
return undefined;
|
|
827
|
-
if (!validBaseBlock(block, constructed, registry))
|
|
828
|
-
return undefined;
|
|
829
|
-
const idBlock = dataProperty(block, "idBlock");
|
|
830
|
-
const lenBlock = dataProperty(block, "lenBlock");
|
|
831
|
-
if (!idBlock || !lenBlock)
|
|
832
|
-
return undefined;
|
|
833
|
-
if (primitiveKind) {
|
|
834
|
-
const bit = primitiveKind === "bit" ? bitPayload(block, registry) : undefined;
|
|
835
|
-
const payload = primitiveKind === "bit" ? bit === null || bit === void 0 ? void 0 : bit.payload : primitivePayload(block, primitiveKind, registry);
|
|
836
|
-
return payload
|
|
837
|
-
? { block, kind: primitiveKind, idBlock, lenBlock, indefinite: false, payload, prefix: bit === null || bit === void 0 ? void 0 : bit.prefix }
|
|
838
|
-
: undefined;
|
|
839
|
-
}
|
|
840
|
-
const child = constructedChild(block, registry);
|
|
841
|
-
const validatedChild = child && inspectNode(child, depth + 1, registry);
|
|
842
|
-
const indefinite = dataProperty(lenBlock, "isIndefiniteForm");
|
|
843
|
-
return validatedChild
|
|
844
|
-
? { block, kind: "constructed", idBlock, lenBlock, indefinite: indefinite === true, child: validatedChild }
|
|
845
|
-
: undefined;
|
|
846
|
-
}
|
|
847
|
-
catch {
|
|
848
|
-
return undefined;
|
|
849
|
-
}
|
|
850
|
-
}
|
|
851
|
-
function buildNode(node, sizeOnly, registry) {
|
|
852
|
-
var _a, _b;
|
|
853
|
-
const id = Reflect.apply(registry.originalIdentificationToBER, node.idBlock, [sizeOnly]);
|
|
854
|
-
if (!(id instanceof ArrayBuffer) || id.byteLength === 0)
|
|
855
|
-
throw TypeError("Built-in identifier encoding failed");
|
|
856
|
-
let payload;
|
|
857
|
-
if (node.kind === "constructed") {
|
|
858
|
-
payload = buildNode(node.child, sizeOnly, registry);
|
|
859
|
-
}
|
|
860
|
-
else {
|
|
861
|
-
payload = node.payload;
|
|
862
|
-
}
|
|
863
|
-
const length = (payload instanceof Uint8Array ? payload.byteLength : payload.total) + ((_b = (_a = node.prefix) === null || _a === void 0 ? void 0 : _a.byteLength) !== null && _b !== void 0 ? _b : 0);
|
|
864
|
-
let len;
|
|
865
|
-
if (node.indefinite) {
|
|
866
|
-
len = Uint8Array.of(0x80).buffer;
|
|
867
|
-
}
|
|
868
|
-
else {
|
|
869
|
-
node.lenBlock.length = length;
|
|
870
|
-
len = Reflect.apply(registry.originalLengthToBER, node.lenBlock, [sizeOnly]);
|
|
871
|
-
if (!(len instanceof ArrayBuffer) || len.byteLength === 0)
|
|
872
|
-
throw TypeError("Built-in length encoding failed");
|
|
873
|
-
}
|
|
874
|
-
const total = id.byteLength + len.byteLength + length + (node.indefinite ? 2 : 0);
|
|
875
|
-
if (!Number.isSafeInteger(total))
|
|
876
|
-
throw RangeError("Built-in encoding is too large");
|
|
877
|
-
return { id, len, payload, length, total, indefinite: node.indefinite, prefix: node.prefix };
|
|
878
|
-
}
|
|
879
|
-
function flatten(node, output, offset, sizeOnly) {
|
|
880
|
-
output.set(new Uint8Array(node.id), offset);
|
|
881
|
-
offset += node.id.byteLength;
|
|
882
|
-
output.set(new Uint8Array(node.len), offset);
|
|
883
|
-
offset += node.len.byteLength;
|
|
884
|
-
if (node.prefix) {
|
|
885
|
-
if (!sizeOnly)
|
|
886
|
-
output.set(node.prefix, offset);
|
|
887
|
-
offset += node.prefix.byteLength;
|
|
888
|
-
}
|
|
889
|
-
if (node.payload instanceof Uint8Array) {
|
|
890
|
-
if (!sizeOnly)
|
|
891
|
-
output.set(node.payload, offset);
|
|
892
|
-
offset += node.payload.byteLength;
|
|
893
|
-
}
|
|
894
|
-
else {
|
|
895
|
-
offset = flatten(node.payload, output, offset, sizeOnly);
|
|
896
|
-
}
|
|
897
|
-
if (node.indefinite)
|
|
898
|
-
offset += 2;
|
|
899
|
-
return offset;
|
|
900
|
-
}
|
|
901
|
-
function tryEncodeBuiltin(block, sizeOnly = false) {
|
|
902
|
-
const registry = builtinRegistry;
|
|
903
|
-
if (!registry || !writerMethodsStable(registry))
|
|
904
|
-
return undefined;
|
|
905
|
-
const validated = inspectNode(block, 0, registry);
|
|
906
|
-
if (!validated)
|
|
907
|
-
return undefined;
|
|
908
|
-
const node = buildNode(validated, sizeOnly, registry);
|
|
909
|
-
const output = new Uint8Array(node.total);
|
|
910
|
-
flatten(node, output, 0, sizeOnly);
|
|
911
|
-
return output.buffer;
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
class BaseBlock extends LocalBaseBlock {
|
|
915
|
-
constructor({ name = EMPTY_STRING, optional = false, primitiveSchema, ...parameters } = {}, valueBlockType) {
|
|
916
|
-
super(parameters);
|
|
917
|
-
this.name = name;
|
|
918
|
-
this.optional = optional;
|
|
919
|
-
if (primitiveSchema) {
|
|
920
|
-
this.primitiveSchema = primitiveSchema;
|
|
921
|
-
}
|
|
922
|
-
this.idBlock = new LocalIdentificationBlock(parameters);
|
|
923
|
-
this.lenBlock = new LocalLengthBlock(parameters);
|
|
924
|
-
this.valueBlock = valueBlockType ? new valueBlockType(parameters) : new ValueBlock(parameters);
|
|
925
|
-
}
|
|
926
|
-
fromBER(inputBuffer, inputOffset, inputLength, context) {
|
|
927
|
-
const resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, this.lenBlock.isIndefiniteForm ? inputLength : this.lenBlock.length, context);
|
|
928
|
-
if (resultOffset === -1) {
|
|
929
|
-
this.error = this.valueBlock.error;
|
|
930
|
-
return resultOffset;
|
|
931
|
-
}
|
|
932
|
-
if (!this.idBlock.error.length)
|
|
933
|
-
this.blockLength += this.idBlock.blockLength;
|
|
934
|
-
if (!this.lenBlock.error.length)
|
|
935
|
-
this.blockLength += this.lenBlock.blockLength;
|
|
936
|
-
if (!this.valueBlock.error.length)
|
|
937
|
-
this.blockLength += this.valueBlock.blockLength;
|
|
938
|
-
return resultOffset;
|
|
939
|
-
}
|
|
940
|
-
toBER(sizeOnly, writer) {
|
|
941
|
-
const _writer = writer || new ViewWriter();
|
|
942
|
-
if (!writer) {
|
|
943
|
-
prepareIndefiniteForm(this);
|
|
944
|
-
if (sizeOnly === true || sizeOnly === false || sizeOnly === undefined) {
|
|
945
|
-
if (shouldUseBuiltinEncoder(this)) {
|
|
946
|
-
const encoded = tryEncodeBuiltin(this, sizeOnly === true);
|
|
947
|
-
if (encoded)
|
|
948
|
-
return encoded;
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
}
|
|
952
|
-
const idBlockBuf = this.idBlock.toBER(sizeOnly);
|
|
953
|
-
_writer.write(idBlockBuf);
|
|
954
|
-
if (this.lenBlock.isIndefiniteForm) {
|
|
955
|
-
_writer.write(new Uint8Array([0x80]).buffer);
|
|
956
|
-
this.valueBlock.toBER(sizeOnly, _writer);
|
|
957
|
-
_writer.write(new ArrayBuffer(2));
|
|
958
|
-
}
|
|
959
|
-
else {
|
|
960
|
-
const valueBlockBuf = this.valueBlock.toBER(sizeOnly);
|
|
961
|
-
this.lenBlock.length = valueBlockBuf.byteLength;
|
|
962
|
-
const lenBlockBuf = this.lenBlock.toBER(sizeOnly);
|
|
963
|
-
_writer.write(lenBlockBuf);
|
|
964
|
-
_writer.write(valueBlockBuf);
|
|
965
|
-
}
|
|
966
|
-
if (!writer) {
|
|
967
|
-
return _writer.final();
|
|
968
|
-
}
|
|
969
|
-
return EMPTY_BUFFER;
|
|
970
|
-
}
|
|
971
|
-
toJSON() {
|
|
972
|
-
const object = {
|
|
973
|
-
...super.toJSON(),
|
|
974
|
-
idBlock: this.idBlock.toJSON(),
|
|
975
|
-
lenBlock: this.lenBlock.toJSON(),
|
|
976
|
-
valueBlock: this.valueBlock.toJSON(),
|
|
977
|
-
name: this.name,
|
|
978
|
-
optional: this.optional
|
|
979
|
-
};
|
|
980
|
-
if (this.primitiveSchema)
|
|
981
|
-
object.primitiveSchema = this.primitiveSchema.toJSON();
|
|
982
|
-
return object;
|
|
983
|
-
}
|
|
984
|
-
toString(encoding = "ascii") {
|
|
985
|
-
if (encoding === "ascii") {
|
|
986
|
-
return this.onAsciiEncoding();
|
|
987
|
-
}
|
|
988
|
-
return pvtsutils__namespace.Convert.ToHex(this.toBER());
|
|
989
|
-
}
|
|
990
|
-
onAsciiEncoding() {
|
|
991
|
-
const name = this.constructor.NAME;
|
|
992
|
-
const value = pvtsutils__namespace.Convert.ToHex(this.valueBlock.valueBeforeDecodeView);
|
|
993
|
-
return `${name} : ${value}`;
|
|
994
|
-
}
|
|
995
|
-
isEqual(other) {
|
|
996
|
-
if (this === other) {
|
|
997
|
-
return true;
|
|
998
|
-
}
|
|
999
|
-
if (!(other instanceof this.constructor)) {
|
|
1000
|
-
return false;
|
|
1001
|
-
}
|
|
1002
|
-
const thisRaw = this.toBER();
|
|
1003
|
-
const otherRaw = other.toBER();
|
|
1004
|
-
return pvutils__namespace.isEqualBuffer(thisRaw, otherRaw);
|
|
1005
|
-
}
|
|
1006
|
-
}
|
|
1007
|
-
BaseBlock.NAME = "BaseBlock";
|
|
1008
|
-
const ORIGINAL_BASE_BLOCK_TO_BER = BaseBlock.prototype.toBER;
|
|
1009
|
-
function prepareIndefiniteForm(baseBlock) {
|
|
1010
|
-
var _a;
|
|
1011
|
-
if (baseBlock instanceof typeStore.Constructed) {
|
|
1012
|
-
for (const value of baseBlock.valueBlock.value) {
|
|
1013
|
-
if (prepareIndefiniteForm(value)) {
|
|
1014
|
-
baseBlock.lenBlock.isIndefiniteForm = true;
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
}
|
|
1018
|
-
return !!((_a = baseBlock.lenBlock) === null || _a === void 0 ? void 0 : _a.isIndefiniteForm);
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
|
-
class BaseStringBlock extends BaseBlock {
|
|
1022
|
-
getValue() {
|
|
1023
|
-
return this.valueBlock.value;
|
|
1024
|
-
}
|
|
1025
|
-
setValue(value) {
|
|
1026
|
-
this.valueBlock.value = value;
|
|
1027
|
-
}
|
|
1028
|
-
constructor({ value = EMPTY_STRING, ...parameters } = {}, stringValueBlockType) {
|
|
1029
|
-
super(parameters, stringValueBlockType);
|
|
1030
|
-
if (value) {
|
|
1031
|
-
this.fromString(value);
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
1035
|
-
const resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, this.lenBlock.isIndefiniteForm ? inputLength : this.lenBlock.length);
|
|
1036
|
-
if (resultOffset === -1) {
|
|
1037
|
-
this.error = this.valueBlock.error;
|
|
1038
|
-
return resultOffset;
|
|
1039
|
-
}
|
|
1040
|
-
this.fromBuffer(this.valueBlock.valueHexView);
|
|
1041
|
-
if (!this.idBlock.error.length)
|
|
1042
|
-
this.blockLength += this.idBlock.blockLength;
|
|
1043
|
-
if (!this.lenBlock.error.length)
|
|
1044
|
-
this.blockLength += this.lenBlock.blockLength;
|
|
1045
|
-
if (!this.valueBlock.error.length)
|
|
1046
|
-
this.blockLength += this.valueBlock.blockLength;
|
|
1047
|
-
return resultOffset;
|
|
1048
|
-
}
|
|
1049
|
-
onAsciiEncoding() {
|
|
1050
|
-
return `${this.constructor.NAME} : '${this.valueBlock.value}'`;
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
BaseStringBlock.NAME = "BaseStringBlock";
|
|
1054
|
-
|
|
1055
|
-
var _a$x;
|
|
1056
|
-
class LocalPrimitiveValueBlock extends HexBlock(ValueBlock) {
|
|
1057
|
-
constructor({ isHexOnly = true, ...parameters } = {}) {
|
|
1058
|
-
super(parameters);
|
|
1059
|
-
this.isHexOnly = isHexOnly;
|
|
1060
|
-
}
|
|
1061
|
-
}
|
|
1062
|
-
LocalPrimitiveValueBlock.NAME = "PrimitiveValueBlock";
|
|
1063
|
-
const ORIGINAL_LOCAL_PRIMITIVE_TO_BER = (_a$x = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(LocalPrimitiveValueBlock.prototype), "toBER")) === null || _a$x === void 0 ? void 0 : _a$x.value;
|
|
1064
|
-
|
|
1065
|
-
var _a$w;
|
|
1066
|
-
class Primitive extends BaseBlock {
|
|
1067
|
-
constructor(parameters = {}) {
|
|
1068
|
-
super(parameters, LocalPrimitiveValueBlock);
|
|
1069
|
-
this.idBlock.isConstructed = false;
|
|
1070
|
-
}
|
|
1071
|
-
}
|
|
1072
|
-
_a$w = Primitive;
|
|
1073
|
-
(() => {
|
|
1074
|
-
typeStore.Primitive = _a$w;
|
|
1075
|
-
})();
|
|
1076
|
-
Primitive.NAME = "PRIMITIVE";
|
|
1077
|
-
|
|
1078
|
-
let fastParserRegistry;
|
|
1079
|
-
function registerFastParser(constructors) {
|
|
1080
|
-
fastParserRegistry = {
|
|
1081
|
-
Integer: constructors.Integer,
|
|
1082
|
-
Null: constructors.Null,
|
|
1083
|
-
Sequence: constructors.Sequence
|
|
1084
|
-
};
|
|
1085
|
-
}
|
|
1086
|
-
function fastParserContext(context) {
|
|
1087
|
-
const nodes = Object.getOwnPropertyDescriptor(context, "nodesCount");
|
|
1088
|
-
const maxNodes = Object.getOwnPropertyDescriptor(context, "maxNodes");
|
|
1089
|
-
const maxContentLength = Object.getOwnPropertyDescriptor(context, "maxContentLength");
|
|
1090
|
-
if (!nodes || !("value" in nodes) || nodes.writable !== true)
|
|
1091
|
-
return false;
|
|
1092
|
-
if (!maxNodes || !("value" in maxNodes) || !maxContentLength || !("value" in maxContentLength))
|
|
1093
|
-
return false;
|
|
1094
|
-
return (typeof nodes.value === "number" &&
|
|
1095
|
-
Number.isSafeInteger(nodes.value) &&
|
|
1096
|
-
nodes.value >= 0 &&
|
|
1097
|
-
typeof maxNodes.value === "number" &&
|
|
1098
|
-
Number.isSafeInteger(maxNodes.value) &&
|
|
1099
|
-
maxNodes.value >= 0 &&
|
|
1100
|
-
typeof maxContentLength.value === "number" &&
|
|
1101
|
-
Number.isSafeInteger(maxContentLength.value) &&
|
|
1102
|
-
maxContentLength.value >= 0 &&
|
|
1103
|
-
nodes.value < maxNodes.value);
|
|
1104
|
-
}
|
|
1105
|
-
function fastParserType(store, name, value) {
|
|
1106
|
-
const descriptor = Object.getOwnPropertyDescriptor(store, name);
|
|
1107
|
-
return !!descriptor && "value" in descriptor && descriptor.value === value;
|
|
1108
|
-
}
|
|
1109
|
-
function tryFastFromBER(inputBuffer, inputOffset, inputLength, context) {
|
|
1110
|
-
const registry = fastParserRegistry;
|
|
1111
|
-
if (!registry)
|
|
1112
|
-
return undefined;
|
|
1113
|
-
let Constructor;
|
|
1114
|
-
let length = 0;
|
|
1115
|
-
try {
|
|
1116
|
-
if (Object.getPrototypeOf(inputBuffer) !== Uint8Array.prototype)
|
|
1117
|
-
return undefined;
|
|
1118
|
-
if (!Number.isSafeInteger(inputOffset) ||
|
|
1119
|
-
inputOffset < 0 ||
|
|
1120
|
-
!Number.isSafeInteger(inputLength) ||
|
|
1121
|
-
inputLength < 2) {
|
|
1122
|
-
return undefined;
|
|
1123
|
-
}
|
|
1124
|
-
if (inputOffset > inputBuffer.byteLength || inputLength > inputBuffer.byteLength - inputOffset)
|
|
1125
|
-
return undefined;
|
|
1126
|
-
const tag = inputBuffer[inputOffset];
|
|
1127
|
-
if (tag !== 0x02 && tag !== 0x05 && tag !== 0x30)
|
|
1128
|
-
return undefined;
|
|
1129
|
-
length = inputBuffer[inputOffset + 1];
|
|
1130
|
-
if (length >= 0x80 || length > inputLength - 2)
|
|
1131
|
-
return undefined;
|
|
1132
|
-
if (tag === 0x05 && length !== 0)
|
|
1133
|
-
return undefined;
|
|
1134
|
-
if (!fastParserContext(context))
|
|
1135
|
-
return undefined;
|
|
1136
|
-
if (length > Object.getOwnPropertyDescriptor(context, "maxContentLength").value) {
|
|
1137
|
-
return undefined;
|
|
1138
|
-
}
|
|
1139
|
-
const constructorName = tag === 0x02 ? "Integer" : tag === 0x05 ? "Null" : "Sequence";
|
|
1140
|
-
Constructor = registry[constructorName];
|
|
1141
|
-
if (!fastParserType(typeStore, constructorName, Constructor))
|
|
1142
|
-
return undefined;
|
|
1143
|
-
const identificationFromBER = Object.getOwnPropertyDescriptor(LocalIdentificationBlock.prototype, "fromBER");
|
|
1144
|
-
const lengthFromBER = Object.getOwnPropertyDescriptor(LocalLengthBlock.prototype, "fromBER");
|
|
1145
|
-
if (!identificationFromBER ||
|
|
1146
|
-
!("value" in identificationFromBER) ||
|
|
1147
|
-
identificationFromBER.value !== ORIGINAL_LOCAL_IDENTIFICATION_FROM_BER ||
|
|
1148
|
-
!lengthFromBER ||
|
|
1149
|
-
!("value" in lengthFromBER) ||
|
|
1150
|
-
lengthFromBER.value !== ORIGINAL_LOCAL_LENGTH_FROM_BER)
|
|
1151
|
-
return undefined;
|
|
1152
|
-
}
|
|
1153
|
-
catch {
|
|
1154
|
-
return undefined;
|
|
1155
|
-
}
|
|
1156
|
-
if (!Constructor)
|
|
1157
|
-
return undefined;
|
|
1158
|
-
const result = new Constructor();
|
|
1159
|
-
result.idBlock.tagClass = 1;
|
|
1160
|
-
result.idBlock.tagNumber = inputBuffer[inputOffset] & 0x1f;
|
|
1161
|
-
result.idBlock.isConstructed = inputBuffer[inputOffset] === 0x30;
|
|
1162
|
-
result.idBlock.isHexOnly = false;
|
|
1163
|
-
result.idBlock.blockLength = 1;
|
|
1164
|
-
result.lenBlock.isIndefiniteForm = false;
|
|
1165
|
-
result.lenBlock.longFormUsed = false;
|
|
1166
|
-
result.lenBlock.length = length;
|
|
1167
|
-
result.lenBlock.blockLength = 1;
|
|
1168
|
-
context.nodesCount += 1;
|
|
1169
|
-
const resultOffset = result.fromBER(inputBuffer, inputOffset + 2, length, context);
|
|
1170
|
-
result.valueBeforeDecodeView = inputBuffer.subarray(inputOffset, inputOffset + result.blockLength);
|
|
1171
|
-
return { offset: resultOffset, result };
|
|
1172
|
-
}
|
|
1173
|
-
const DEFAULT_MAX_DEPTH = 100;
|
|
1174
|
-
const DEFAULT_MAX_NODES = 10000;
|
|
1175
|
-
const DEFAULT_MAX_CONTENT_LENGTH = 16 * 1024 * 1024;
|
|
1176
|
-
const MAX_DEPTH_EXCEEDED_ERROR = "Maximum ASN.1 nesting depth exceeded";
|
|
1177
|
-
const MAX_NODES_EXCEEDED_ERROR = "Maximum ASN.1 node count exceeded";
|
|
1178
|
-
const MAX_CONTENT_LENGTH_EXCEEDED_ERROR = "Maximum ASN.1 content length exceeded";
|
|
1179
|
-
function createFromBerContext(options = {}) {
|
|
1180
|
-
var _a, _b, _c, _d;
|
|
1181
|
-
return {
|
|
1182
|
-
depth: 0,
|
|
1183
|
-
maxDepth: (_a = options.maxDepth) !== null && _a !== void 0 ? _a : DEFAULT_MAX_DEPTH,
|
|
1184
|
-
nodesCount: 0,
|
|
1185
|
-
maxNodes: (_b = options.maxNodes) !== null && _b !== void 0 ? _b : DEFAULT_MAX_NODES,
|
|
1186
|
-
maxContentLength: (_c = options.maxContentLength) !== null && _c !== void 0 ? _c : DEFAULT_MAX_CONTENT_LENGTH,
|
|
1187
|
-
parseEmbedded: (_d = options.parseEmbedded) !== null && _d !== void 0 ? _d : true
|
|
1188
|
-
};
|
|
1189
|
-
}
|
|
1190
|
-
function createErrorResult(error) {
|
|
1191
|
-
const result = new BaseBlock({}, ValueBlock);
|
|
1192
|
-
result.error = error;
|
|
1193
|
-
return {
|
|
1194
|
-
offset: -1,
|
|
1195
|
-
result
|
|
1196
|
-
};
|
|
1197
|
-
}
|
|
1198
|
-
function checkNodesLimit(context) {
|
|
1199
|
-
context.nodesCount += 1;
|
|
1200
|
-
if (context.nodesCount > context.maxNodes) {
|
|
1201
|
-
return MAX_NODES_EXCEEDED_ERROR;
|
|
1202
|
-
}
|
|
1203
|
-
return undefined;
|
|
1204
|
-
}
|
|
1205
|
-
function checkContentLengthLimit(inputLength, context) {
|
|
1206
|
-
if (inputLength > context.maxContentLength) {
|
|
1207
|
-
return MAX_CONTENT_LENGTH_EXCEEDED_ERROR;
|
|
1208
|
-
}
|
|
1209
|
-
return undefined;
|
|
1210
|
-
}
|
|
1211
|
-
function localFromBERWithChildContext(inputBuffer, inputOffset, inputLength, context) {
|
|
1212
|
-
const childDepth = context.depth + 1;
|
|
1213
|
-
if (childDepth > context.maxDepth) {
|
|
1214
|
-
return createErrorResult(MAX_DEPTH_EXCEEDED_ERROR);
|
|
1215
|
-
}
|
|
1216
|
-
context.depth = childDepth;
|
|
1217
|
-
try {
|
|
1218
|
-
return localFromBER(inputBuffer, inputOffset, inputLength, context);
|
|
1219
|
-
}
|
|
1220
|
-
finally {
|
|
1221
|
-
context.depth -= 1;
|
|
1222
|
-
}
|
|
1223
|
-
}
|
|
1224
|
-
function localChangeType(inputObject, newType) {
|
|
1225
|
-
if (inputObject instanceof newType) {
|
|
1226
|
-
return inputObject;
|
|
1227
|
-
}
|
|
1228
|
-
const newObject = new newType();
|
|
1229
|
-
newObject.idBlock = inputObject.idBlock;
|
|
1230
|
-
newObject.lenBlock = inputObject.lenBlock;
|
|
1231
|
-
newObject.warnings = inputObject.warnings;
|
|
1232
|
-
newObject.valueBeforeDecodeView = inputObject.valueBeforeDecodeView;
|
|
1233
|
-
return newObject;
|
|
1234
|
-
}
|
|
1235
|
-
function localFromBER(inputBuffer, inputOffset = 0, inputLength = inputBuffer.length, context = createFromBerContext()) {
|
|
1236
|
-
const fastResult = tryFastFromBER(inputBuffer, inputOffset, inputLength, context);
|
|
1237
|
-
if (fastResult)
|
|
1238
|
-
return fastResult;
|
|
1239
|
-
const incomingOffset = inputOffset;
|
|
1240
|
-
let returnObject = new BaseBlock({}, ValueBlock);
|
|
1241
|
-
if (!checkBufferParams(returnObject, inputBuffer, inputOffset, inputLength)) {
|
|
1242
|
-
return {
|
|
1243
|
-
offset: -1,
|
|
1244
|
-
result: returnObject
|
|
1245
|
-
};
|
|
1246
|
-
}
|
|
1247
|
-
const fastArgs = Number.isInteger(inputOffset) && Number.isInteger(inputLength);
|
|
1248
|
-
if (fastArgs ? inputLength === 0 : inputBuffer.subarray(inputOffset, inputOffset + inputLength).length === 0) {
|
|
1249
|
-
returnObject.error = "Zero buffer length";
|
|
1250
|
-
return {
|
|
1251
|
-
offset: -1,
|
|
1252
|
-
result: returnObject
|
|
1253
|
-
};
|
|
1254
|
-
}
|
|
1255
|
-
const nodesLimitError = checkNodesLimit(context);
|
|
1256
|
-
if (nodesLimitError) {
|
|
1257
|
-
returnObject.error = nodesLimitError;
|
|
1258
|
-
return {
|
|
1259
|
-
offset: -1,
|
|
1260
|
-
result: returnObject
|
|
1261
|
-
};
|
|
1262
|
-
}
|
|
1263
|
-
let resultOffset = returnObject.idBlock.fromBER(inputBuffer, inputOffset, inputLength);
|
|
1264
|
-
if (returnObject.idBlock.warnings.length) {
|
|
1265
|
-
returnObject.warnings.concat(returnObject.idBlock.warnings);
|
|
1266
|
-
}
|
|
1267
|
-
if (resultOffset === -1) {
|
|
1268
|
-
returnObject.error = returnObject.idBlock.error;
|
|
1269
|
-
return {
|
|
1270
|
-
offset: -1,
|
|
1271
|
-
result: returnObject
|
|
1272
|
-
};
|
|
1273
|
-
}
|
|
1274
|
-
inputOffset = resultOffset;
|
|
1275
|
-
inputLength -= returnObject.idBlock.blockLength;
|
|
1276
|
-
resultOffset = returnObject.lenBlock.fromBER(inputBuffer, inputOffset, inputLength);
|
|
1277
|
-
if (returnObject.lenBlock.warnings.length) {
|
|
1278
|
-
returnObject.warnings.concat(returnObject.lenBlock.warnings);
|
|
1279
|
-
}
|
|
1280
|
-
if (resultOffset === -1) {
|
|
1281
|
-
returnObject.error = returnObject.lenBlock.error;
|
|
1282
|
-
return {
|
|
1283
|
-
offset: -1,
|
|
1284
|
-
result: returnObject
|
|
1285
|
-
};
|
|
1286
|
-
}
|
|
1287
|
-
inputOffset = resultOffset;
|
|
1288
|
-
inputLength -= returnObject.lenBlock.blockLength;
|
|
1289
|
-
const valueLength = returnObject.lenBlock.isIndefiniteForm ? inputLength : returnObject.lenBlock.length;
|
|
1290
|
-
const contentLengthError = checkContentLengthLimit(valueLength, context);
|
|
1291
|
-
if (contentLengthError) {
|
|
1292
|
-
returnObject.error = contentLengthError;
|
|
1293
|
-
return {
|
|
1294
|
-
offset: -1,
|
|
1295
|
-
result: returnObject
|
|
1296
|
-
};
|
|
1297
|
-
}
|
|
1298
|
-
if (!returnObject.idBlock.isConstructed && returnObject.lenBlock.isIndefiniteForm) {
|
|
1299
|
-
returnObject.error = "Indefinite length form used for primitive encoding form";
|
|
1300
|
-
return {
|
|
1301
|
-
offset: -1,
|
|
1302
|
-
result: returnObject
|
|
1303
|
-
};
|
|
1304
|
-
}
|
|
1305
|
-
let newASN1Type = BaseBlock;
|
|
1306
|
-
switch (returnObject.idBlock.tagClass) {
|
|
1307
|
-
case 1:
|
|
1308
|
-
if (returnObject.idBlock.tagNumber >= 37 && returnObject.idBlock.isHexOnly === false) {
|
|
1309
|
-
returnObject.error = "UNIVERSAL 37 and upper tags are reserved by ASN.1 standard";
|
|
1310
|
-
return {
|
|
1311
|
-
offset: -1,
|
|
1312
|
-
result: returnObject
|
|
1313
|
-
};
|
|
1314
|
-
}
|
|
1315
|
-
switch (returnObject.idBlock.tagNumber) {
|
|
1316
|
-
case 0:
|
|
1317
|
-
if (returnObject.idBlock.isConstructed && returnObject.lenBlock.length > 0) {
|
|
1318
|
-
returnObject.error = "Type [UNIVERSAL 0] is reserved";
|
|
1319
|
-
return {
|
|
1320
|
-
offset: -1,
|
|
1321
|
-
result: returnObject
|
|
1322
|
-
};
|
|
1323
|
-
}
|
|
1324
|
-
newASN1Type = typeStore.EndOfContent;
|
|
1325
|
-
break;
|
|
1326
|
-
case 1:
|
|
1327
|
-
newASN1Type = typeStore.Boolean;
|
|
1328
|
-
break;
|
|
1329
|
-
case 2:
|
|
1330
|
-
newASN1Type = typeStore.Integer;
|
|
1331
|
-
break;
|
|
1332
|
-
case 3:
|
|
1333
|
-
newASN1Type = typeStore.BitString;
|
|
1334
|
-
break;
|
|
1335
|
-
case 4:
|
|
1336
|
-
newASN1Type = typeStore.OctetString;
|
|
1337
|
-
break;
|
|
1338
|
-
case 5:
|
|
1339
|
-
newASN1Type = typeStore.Null;
|
|
1340
|
-
break;
|
|
1341
|
-
case 6:
|
|
1342
|
-
newASN1Type = typeStore.ObjectIdentifier;
|
|
1343
|
-
break;
|
|
1344
|
-
case 10:
|
|
1345
|
-
newASN1Type = typeStore.Enumerated;
|
|
1346
|
-
break;
|
|
1347
|
-
case 12:
|
|
1348
|
-
newASN1Type = typeStore.Utf8String;
|
|
1349
|
-
break;
|
|
1350
|
-
case 13:
|
|
1351
|
-
newASN1Type = typeStore.RelativeObjectIdentifier;
|
|
1352
|
-
break;
|
|
1353
|
-
case 14:
|
|
1354
|
-
newASN1Type = typeStore.TIME;
|
|
1355
|
-
break;
|
|
1356
|
-
case 15:
|
|
1357
|
-
returnObject.error = "[UNIVERSAL 15] is reserved by ASN.1 standard";
|
|
1358
|
-
return {
|
|
1359
|
-
offset: -1,
|
|
1360
|
-
result: returnObject
|
|
1361
|
-
};
|
|
1362
|
-
case 16:
|
|
1363
|
-
newASN1Type = typeStore.Sequence;
|
|
1364
|
-
break;
|
|
1365
|
-
case 17:
|
|
1366
|
-
newASN1Type = typeStore.Set;
|
|
1367
|
-
break;
|
|
1368
|
-
case 18:
|
|
1369
|
-
newASN1Type = typeStore.NumericString;
|
|
1370
|
-
break;
|
|
1371
|
-
case 19:
|
|
1372
|
-
newASN1Type = typeStore.PrintableString;
|
|
1373
|
-
break;
|
|
1374
|
-
case 20:
|
|
1375
|
-
newASN1Type = typeStore.TeletexString;
|
|
1376
|
-
break;
|
|
1377
|
-
case 21:
|
|
1378
|
-
newASN1Type = typeStore.VideotexString;
|
|
1379
|
-
break;
|
|
1380
|
-
case 22:
|
|
1381
|
-
newASN1Type = typeStore.IA5String;
|
|
1382
|
-
break;
|
|
1383
|
-
case 23:
|
|
1384
|
-
newASN1Type = typeStore.UTCTime;
|
|
1385
|
-
break;
|
|
1386
|
-
case 24:
|
|
1387
|
-
newASN1Type = typeStore.GeneralizedTime;
|
|
1388
|
-
break;
|
|
1389
|
-
case 25:
|
|
1390
|
-
newASN1Type = typeStore.GraphicString;
|
|
1391
|
-
break;
|
|
1392
|
-
case 26:
|
|
1393
|
-
newASN1Type = typeStore.VisibleString;
|
|
1394
|
-
break;
|
|
1395
|
-
case 27:
|
|
1396
|
-
newASN1Type = typeStore.GeneralString;
|
|
1397
|
-
break;
|
|
1398
|
-
case 28:
|
|
1399
|
-
newASN1Type = typeStore.UniversalString;
|
|
1400
|
-
break;
|
|
1401
|
-
case 29:
|
|
1402
|
-
newASN1Type = typeStore.CharacterString;
|
|
1403
|
-
break;
|
|
1404
|
-
case 30:
|
|
1405
|
-
newASN1Type = typeStore.BmpString;
|
|
1406
|
-
break;
|
|
1407
|
-
case 31:
|
|
1408
|
-
newASN1Type = typeStore.DATE;
|
|
1409
|
-
break;
|
|
1410
|
-
case 32:
|
|
1411
|
-
newASN1Type = typeStore.TimeOfDay;
|
|
1412
|
-
break;
|
|
1413
|
-
case 33:
|
|
1414
|
-
newASN1Type = typeStore.DateTime;
|
|
1415
|
-
break;
|
|
1416
|
-
case 34:
|
|
1417
|
-
newASN1Type = typeStore.Duration;
|
|
1418
|
-
break;
|
|
1419
|
-
default: {
|
|
1420
|
-
const newObject = returnObject.idBlock.isConstructed
|
|
1421
|
-
? new typeStore.Constructed()
|
|
1422
|
-
: new typeStore.Primitive();
|
|
1423
|
-
newObject.idBlock = returnObject.idBlock;
|
|
1424
|
-
newObject.lenBlock = returnObject.lenBlock;
|
|
1425
|
-
newObject.warnings = returnObject.warnings;
|
|
1426
|
-
returnObject = newObject;
|
|
1427
|
-
}
|
|
1428
|
-
}
|
|
1429
|
-
break;
|
|
1430
|
-
case 2:
|
|
1431
|
-
case 3:
|
|
1432
|
-
case 4:
|
|
1433
|
-
default: {
|
|
1434
|
-
newASN1Type = returnObject.idBlock.isConstructed ? typeStore.Constructed : typeStore.Primitive;
|
|
1435
|
-
}
|
|
1436
|
-
}
|
|
1437
|
-
returnObject = localChangeType(returnObject, newASN1Type);
|
|
1438
|
-
resultOffset = returnObject.fromBER(inputBuffer, inputOffset, valueLength, context);
|
|
1439
|
-
returnObject.valueBeforeDecodeView = inputBuffer.subarray(incomingOffset, incomingOffset + returnObject.blockLength);
|
|
1440
|
-
return {
|
|
1441
|
-
offset: resultOffset,
|
|
1442
|
-
result: returnObject
|
|
1443
|
-
};
|
|
1444
|
-
}
|
|
1445
|
-
function fromBER(inputBuffer, options = {}) {
|
|
1446
|
-
if (!inputBuffer.byteLength) {
|
|
1447
|
-
const result = new BaseBlock({}, ValueBlock);
|
|
1448
|
-
result.error = "Input buffer has zero length";
|
|
1449
|
-
return {
|
|
1450
|
-
offset: -1,
|
|
1451
|
-
result
|
|
1452
|
-
};
|
|
1453
|
-
}
|
|
1454
|
-
const inputView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
1455
|
-
const normalizedInput = options.copyInput === false ? inputView : inputView.slice();
|
|
1456
|
-
return localFromBER(normalizedInput, 0, inputBuffer.byteLength, createFromBerContext(options));
|
|
1457
|
-
}
|
|
1458
|
-
|
|
1459
|
-
function checkLen(indefiniteLength, length) {
|
|
1460
|
-
if (indefiniteLength) {
|
|
1461
|
-
return 1;
|
|
1462
|
-
}
|
|
1463
|
-
return length;
|
|
1464
|
-
}
|
|
1465
|
-
class LocalConstructedValueBlock extends ValueBlock {
|
|
1466
|
-
constructor({ value = [], isIndefiniteForm = false, ...parameters } = {}) {
|
|
1467
|
-
super(parameters);
|
|
1468
|
-
this.value = value;
|
|
1469
|
-
this.isIndefiniteForm = isIndefiniteForm;
|
|
1470
|
-
}
|
|
1471
|
-
fromBER(inputBuffer, inputOffset, inputLength, context) {
|
|
1472
|
-
const view = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
1473
|
-
const parseContext = context !== null && context !== void 0 ? context : createFromBerContext();
|
|
1474
|
-
if (!checkBufferParams(this, view, inputOffset, inputLength)) {
|
|
1475
|
-
return -1;
|
|
1476
|
-
}
|
|
1477
|
-
this.valueBeforeDecodeView = view.subarray(inputOffset, inputOffset + inputLength);
|
|
1478
|
-
if (this.valueBeforeDecodeView.length === 0) {
|
|
1479
|
-
this.warnings.push("Zero buffer length");
|
|
1480
|
-
return inputOffset;
|
|
1481
|
-
}
|
|
1482
|
-
let currentOffset = inputOffset;
|
|
1483
|
-
while (checkLen(this.isIndefiniteForm, inputLength) > 0) {
|
|
1484
|
-
const returnObject = localFromBERWithChildContext(view, currentOffset, inputLength, parseContext);
|
|
1485
|
-
if (returnObject.offset === -1) {
|
|
1486
|
-
this.error = returnObject.result.error;
|
|
1487
|
-
this.warnings.concat(returnObject.result.warnings);
|
|
1488
|
-
return -1;
|
|
1489
|
-
}
|
|
1490
|
-
currentOffset = returnObject.offset;
|
|
1491
|
-
this.blockLength += returnObject.result.blockLength;
|
|
1492
|
-
inputLength -= returnObject.result.blockLength;
|
|
1493
|
-
this.value.push(returnObject.result);
|
|
1494
|
-
if (this.isIndefiniteForm && returnObject.result.constructor.NAME === END_OF_CONTENT_NAME) {
|
|
1495
|
-
break;
|
|
1496
|
-
}
|
|
1497
|
-
}
|
|
1498
|
-
if (this.isIndefiniteForm) {
|
|
1499
|
-
if (this.value[this.value.length - 1].constructor.NAME === END_OF_CONTENT_NAME) {
|
|
1500
|
-
this.value.pop();
|
|
1501
|
-
}
|
|
1502
|
-
else {
|
|
1503
|
-
this.warnings.push("No EndOfContent block encoded");
|
|
1504
|
-
}
|
|
1505
|
-
}
|
|
1506
|
-
return currentOffset;
|
|
1507
|
-
}
|
|
1508
|
-
toBER(sizeOnly, writer) {
|
|
1509
|
-
const _writer = writer || new ViewWriter();
|
|
1510
|
-
for (let i = 0; i < this.value.length; i++) {
|
|
1511
|
-
this.value[i].toBER(sizeOnly, _writer);
|
|
1512
|
-
}
|
|
1513
|
-
if (!writer) {
|
|
1514
|
-
return _writer.final();
|
|
1515
|
-
}
|
|
1516
|
-
return EMPTY_BUFFER;
|
|
1517
|
-
}
|
|
1518
|
-
toJSON() {
|
|
1519
|
-
const object = {
|
|
1520
|
-
...super.toJSON(),
|
|
1521
|
-
isIndefiniteForm: this.isIndefiniteForm,
|
|
1522
|
-
value: []
|
|
1523
|
-
};
|
|
1524
|
-
for (const value of this.value) {
|
|
1525
|
-
object.value.push(value.toJSON());
|
|
1526
|
-
}
|
|
1527
|
-
return object;
|
|
1528
|
-
}
|
|
1529
|
-
}
|
|
1530
|
-
LocalConstructedValueBlock.NAME = "ConstructedValueBlock";
|
|
1531
|
-
const ORIGINAL_LOCAL_CONSTRUCTED_TO_BER = LocalConstructedValueBlock.prototype.toBER;
|
|
1532
|
-
|
|
1533
|
-
var _a$v;
|
|
1534
|
-
class Constructed extends BaseBlock {
|
|
1535
|
-
constructor(parameters = {}) {
|
|
1536
|
-
super(parameters, LocalConstructedValueBlock);
|
|
1537
|
-
this.idBlock.isConstructed = true;
|
|
1538
|
-
}
|
|
1539
|
-
fromBER(inputBuffer, inputOffset, inputLength, context) {
|
|
1540
|
-
this.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm;
|
|
1541
|
-
const resultOffset = this.valueBlock.fromBER(inputBuffer, inputOffset, this.lenBlock.isIndefiniteForm ? inputLength : this.lenBlock.length, context);
|
|
1542
|
-
if (resultOffset === -1) {
|
|
1543
|
-
this.error = this.valueBlock.error;
|
|
1544
|
-
return resultOffset;
|
|
1545
|
-
}
|
|
1546
|
-
if (!this.idBlock.error.length)
|
|
1547
|
-
this.blockLength += this.idBlock.blockLength;
|
|
1548
|
-
if (!this.lenBlock.error.length)
|
|
1549
|
-
this.blockLength += this.lenBlock.blockLength;
|
|
1550
|
-
if (!this.valueBlock.error.length)
|
|
1551
|
-
this.blockLength += this.valueBlock.blockLength;
|
|
1552
|
-
return resultOffset;
|
|
1553
|
-
}
|
|
1554
|
-
onAsciiEncoding() {
|
|
1555
|
-
const values = [];
|
|
1556
|
-
for (const value of this.valueBlock.value) {
|
|
1557
|
-
values.push(value
|
|
1558
|
-
.toString("ascii")
|
|
1559
|
-
.split("\n")
|
|
1560
|
-
.map(o => ` ${o}`)
|
|
1561
|
-
.join("\n"));
|
|
1562
|
-
}
|
|
1563
|
-
const blockName = this.idBlock.tagClass === 3 ? `[${this.idBlock.tagNumber}]` : this.constructor.NAME;
|
|
1564
|
-
return values.length
|
|
1565
|
-
? `${blockName} :\n${values.join("\n")}`
|
|
1566
|
-
: `${blockName} :`;
|
|
1567
|
-
}
|
|
1568
|
-
}
|
|
1569
|
-
_a$v = Constructed;
|
|
1570
|
-
(() => {
|
|
1571
|
-
typeStore.Constructed = _a$v;
|
|
1572
|
-
})();
|
|
1573
|
-
Constructed.NAME = "CONSTRUCTED";
|
|
1574
|
-
|
|
1575
|
-
class LocalEndOfContentValueBlock extends ValueBlock {
|
|
1576
|
-
fromBER(inputBuffer, inputOffset, _inputLength) {
|
|
1577
|
-
return inputOffset;
|
|
1578
|
-
}
|
|
1579
|
-
toBER(_sizeOnly) {
|
|
1580
|
-
return EMPTY_BUFFER;
|
|
1581
|
-
}
|
|
1582
|
-
}
|
|
1583
|
-
LocalEndOfContentValueBlock.override = "EndOfContentValueBlock";
|
|
1584
|
-
|
|
1585
|
-
var _a$u;
|
|
1586
|
-
class EndOfContent extends BaseBlock {
|
|
1587
|
-
constructor(parameters = {}) {
|
|
1588
|
-
super(parameters, LocalEndOfContentValueBlock);
|
|
1589
|
-
this.idBlock.tagClass = 1;
|
|
1590
|
-
this.idBlock.tagNumber = 0;
|
|
1591
|
-
}
|
|
1592
|
-
}
|
|
1593
|
-
_a$u = EndOfContent;
|
|
1594
|
-
(() => {
|
|
1595
|
-
typeStore.EndOfContent = _a$u;
|
|
1596
|
-
})();
|
|
1597
|
-
EndOfContent.NAME = END_OF_CONTENT_NAME;
|
|
1598
|
-
|
|
1599
|
-
var _a$t;
|
|
1600
|
-
class Null extends BaseBlock {
|
|
1601
|
-
constructor(parameters = {}) {
|
|
1602
|
-
super(parameters, ValueBlock);
|
|
1603
|
-
this.idBlock.tagClass = 1;
|
|
1604
|
-
this.idBlock.tagNumber = 5;
|
|
1605
|
-
}
|
|
1606
|
-
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
1607
|
-
if (this.lenBlock.length > 0)
|
|
1608
|
-
this.warnings.push("Non-zero length of value block for Null type");
|
|
1609
|
-
if (!this.idBlock.error.length)
|
|
1610
|
-
this.blockLength += this.idBlock.blockLength;
|
|
1611
|
-
if (!this.lenBlock.error.length)
|
|
1612
|
-
this.blockLength += this.lenBlock.blockLength;
|
|
1613
|
-
this.blockLength += inputLength;
|
|
1614
|
-
if (inputOffset + inputLength > inputBuffer.byteLength) {
|
|
1615
|
-
this.error = "End of input reached before message was fully decoded (inconsistent offset and length values)";
|
|
1616
|
-
return -1;
|
|
1617
|
-
}
|
|
1618
|
-
return inputOffset + inputLength;
|
|
1619
|
-
}
|
|
1620
|
-
toBER(sizeOnly, writer) {
|
|
1621
|
-
const retBuf = new ArrayBuffer(2);
|
|
1622
|
-
if (!sizeOnly) {
|
|
1623
|
-
const retView = new Uint8Array(retBuf);
|
|
1624
|
-
retView[0] = 0x05;
|
|
1625
|
-
retView[1] = 0x00;
|
|
1626
|
-
}
|
|
1627
|
-
if (writer) {
|
|
1628
|
-
writer.write(retBuf);
|
|
1629
|
-
}
|
|
1630
|
-
return retBuf;
|
|
1631
|
-
}
|
|
1632
|
-
onAsciiEncoding() {
|
|
1633
|
-
return `${this.constructor.NAME}`;
|
|
1634
|
-
}
|
|
1635
|
-
}
|
|
1636
|
-
_a$t = Null;
|
|
1637
|
-
(() => {
|
|
1638
|
-
typeStore.Null = _a$t;
|
|
1639
|
-
})();
|
|
1640
|
-
Null.NAME = "NULL";
|
|
1641
|
-
|
|
1642
|
-
class LocalBooleanValueBlock extends HexBlock(ValueBlock) {
|
|
1643
|
-
get value() {
|
|
1644
|
-
for (const octet of this.valueHexView) {
|
|
1645
|
-
if (octet > 0) {
|
|
1646
|
-
return true;
|
|
1647
|
-
}
|
|
1648
|
-
}
|
|
1649
|
-
return false;
|
|
1650
|
-
}
|
|
1651
|
-
set value(value) {
|
|
1652
|
-
this.valueHexView[0] = value ? 0xff : 0x00;
|
|
1653
|
-
}
|
|
1654
|
-
constructor({ value, ...parameters } = {}) {
|
|
1655
|
-
super(parameters);
|
|
1656
|
-
if (parameters.valueHex) {
|
|
1657
|
-
this.valueHexView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(parameters.valueHex);
|
|
1658
|
-
}
|
|
1659
|
-
else {
|
|
1660
|
-
this.valueHexView = new Uint8Array(1);
|
|
1661
|
-
}
|
|
1662
|
-
if (value) {
|
|
1663
|
-
this.value = value;
|
|
1664
|
-
}
|
|
1665
|
-
}
|
|
1666
|
-
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
1667
|
-
const inputView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
1668
|
-
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
1669
|
-
return -1;
|
|
1670
|
-
}
|
|
1671
|
-
this.valueHexView = inputView.subarray(inputOffset, inputOffset + inputLength);
|
|
1672
|
-
if (inputLength > 1)
|
|
1673
|
-
this.warnings.push("Boolean value encoded in more then 1 octet");
|
|
1674
|
-
this.isHexOnly = true;
|
|
1675
|
-
pvutils__namespace.utilDecodeTC.call(this);
|
|
1676
|
-
this.blockLength = inputLength;
|
|
1677
|
-
return inputOffset + inputLength;
|
|
1678
|
-
}
|
|
1679
|
-
toBER() {
|
|
1680
|
-
return this.valueHexView.slice().buffer;
|
|
1681
|
-
}
|
|
1682
|
-
toJSON() {
|
|
1683
|
-
return {
|
|
1684
|
-
...super.toJSON(),
|
|
1685
|
-
value: this.value
|
|
1686
|
-
};
|
|
1687
|
-
}
|
|
1688
|
-
}
|
|
1689
|
-
LocalBooleanValueBlock.NAME = "BooleanValueBlock";
|
|
1690
|
-
|
|
1691
|
-
var _a$s;
|
|
1692
|
-
class Boolean extends BaseBlock {
|
|
1693
|
-
getValue() {
|
|
1694
|
-
return this.valueBlock.value;
|
|
1695
|
-
}
|
|
1696
|
-
setValue(value) {
|
|
1697
|
-
this.valueBlock.value = value;
|
|
1698
|
-
}
|
|
1699
|
-
constructor(parameters = {}) {
|
|
1700
|
-
super(parameters, LocalBooleanValueBlock);
|
|
1701
|
-
this.idBlock.tagClass = 1;
|
|
1702
|
-
this.idBlock.tagNumber = 1;
|
|
1703
|
-
}
|
|
1704
|
-
onAsciiEncoding() {
|
|
1705
|
-
return `${this.constructor.NAME} : ${this.getValue}`;
|
|
1706
|
-
}
|
|
1707
|
-
}
|
|
1708
|
-
_a$s = Boolean;
|
|
1709
|
-
(() => {
|
|
1710
|
-
typeStore.Boolean = _a$s;
|
|
1711
|
-
})();
|
|
1712
|
-
Boolean.NAME = "BOOLEAN";
|
|
1713
|
-
|
|
1714
|
-
class LocalOctetStringValueBlock extends HexBlock(LocalConstructedValueBlock) {
|
|
1715
|
-
constructor({ isConstructed = false, ...parameters } = {}) {
|
|
1716
|
-
super(parameters);
|
|
1717
|
-
this.isConstructed = isConstructed;
|
|
1718
|
-
}
|
|
1719
|
-
fromBER(inputBuffer, inputOffset, inputLength, context) {
|
|
1720
|
-
let resultOffset = 0;
|
|
1721
|
-
if (this.isConstructed) {
|
|
1722
|
-
this.isHexOnly = false;
|
|
1723
|
-
resultOffset = LocalConstructedValueBlock.prototype.fromBER.call(this, inputBuffer, inputOffset, inputLength, context);
|
|
1724
|
-
if (resultOffset === -1)
|
|
1725
|
-
return resultOffset;
|
|
1726
|
-
for (let i = 0; i < this.value.length; i++) {
|
|
1727
|
-
const currentBlockName = this.value[i].constructor.NAME;
|
|
1728
|
-
if (currentBlockName === END_OF_CONTENT_NAME) {
|
|
1729
|
-
if (this.isIndefiniteForm)
|
|
1730
|
-
break;
|
|
1731
|
-
else {
|
|
1732
|
-
this.error = "EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only";
|
|
1733
|
-
return -1;
|
|
1734
|
-
}
|
|
1735
|
-
}
|
|
1736
|
-
if (currentBlockName !== OCTET_STRING_NAME) {
|
|
1737
|
-
this.error = "OCTET STRING may consists of OCTET STRINGs only";
|
|
1738
|
-
return -1;
|
|
1739
|
-
}
|
|
1740
|
-
}
|
|
1741
|
-
}
|
|
1742
|
-
else {
|
|
1743
|
-
this.isHexOnly = true;
|
|
1744
|
-
resultOffset = super.fromBER(inputBuffer, inputOffset, inputLength);
|
|
1745
|
-
this.blockLength = inputLength;
|
|
1746
|
-
}
|
|
1747
|
-
return resultOffset;
|
|
1748
|
-
}
|
|
1749
|
-
toBER(sizeOnly, writer) {
|
|
1750
|
-
if (this.isConstructed)
|
|
1751
|
-
return LocalConstructedValueBlock.prototype.toBER.call(this, sizeOnly, writer);
|
|
1752
|
-
return sizeOnly ? new ArrayBuffer(this.valueHexView.byteLength) : this.valueHexView.slice().buffer;
|
|
1753
|
-
}
|
|
1754
|
-
toJSON() {
|
|
1755
|
-
return {
|
|
1756
|
-
...super.toJSON(),
|
|
1757
|
-
isConstructed: this.isConstructed
|
|
1758
|
-
};
|
|
1759
|
-
}
|
|
1760
|
-
}
|
|
1761
|
-
LocalOctetStringValueBlock.NAME = "OctetStringValueBlock";
|
|
1762
|
-
const ORIGINAL_LOCAL_OCTET_STRING_TO_BER = LocalOctetStringValueBlock.prototype.toBER;
|
|
1763
|
-
|
|
1764
|
-
var _a$r;
|
|
1765
|
-
class OctetString extends BaseBlock {
|
|
1766
|
-
constructor({ idBlock = {}, lenBlock = {}, ...parameters } = {}) {
|
|
1767
|
-
var _b, _c;
|
|
1768
|
-
(_b = parameters.isConstructed) !== null && _b !== void 0 ? _b : (parameters.isConstructed = !!((_c = parameters.value) === null || _c === void 0 ? void 0 : _c.length));
|
|
1769
|
-
super({
|
|
1770
|
-
idBlock: {
|
|
1771
|
-
isConstructed: parameters.isConstructed,
|
|
1772
|
-
...idBlock
|
|
1773
|
-
},
|
|
1774
|
-
lenBlock: {
|
|
1775
|
-
...lenBlock,
|
|
1776
|
-
isIndefiniteForm: !!parameters.isIndefiniteForm
|
|
1777
|
-
},
|
|
1778
|
-
...parameters
|
|
1779
|
-
}, LocalOctetStringValueBlock);
|
|
1780
|
-
this.idBlock.tagClass = 1;
|
|
1781
|
-
this.idBlock.tagNumber = 4;
|
|
1782
|
-
}
|
|
1783
|
-
fromBER(inputBuffer, inputOffset, inputLength, context) {
|
|
1784
|
-
this.valueBlock.isConstructed = this.idBlock.isConstructed;
|
|
1785
|
-
this.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm;
|
|
1786
|
-
if (inputLength === 0) {
|
|
1787
|
-
if (this.idBlock.error.length === 0)
|
|
1788
|
-
this.blockLength += this.idBlock.blockLength;
|
|
1789
|
-
if (this.lenBlock.error.length === 0)
|
|
1790
|
-
this.blockLength += this.lenBlock.blockLength;
|
|
1791
|
-
return inputOffset;
|
|
1792
|
-
}
|
|
1793
|
-
if (!this.valueBlock.isConstructed && (context === null || context === void 0 ? void 0 : context.parseEmbedded) !== false) {
|
|
1794
|
-
const view = inputBuffer instanceof ArrayBuffer ? new Uint8Array(inputBuffer) : inputBuffer;
|
|
1795
|
-
const buf = view.subarray(inputOffset, inputOffset + inputLength);
|
|
1796
|
-
try {
|
|
1797
|
-
if (buf.byteLength) {
|
|
1798
|
-
const parseContext = context !== null && context !== void 0 ? context : createFromBerContext();
|
|
1799
|
-
const asn = localFromBERWithChildContext(buf, 0, buf.byteLength, parseContext);
|
|
1800
|
-
if (asn.offset !== -1 && asn.offset === inputLength) {
|
|
1801
|
-
this.valueBlock.value = [asn.result];
|
|
1802
|
-
}
|
|
1803
|
-
}
|
|
1804
|
-
}
|
|
1805
|
-
catch {
|
|
1806
|
-
}
|
|
1807
|
-
}
|
|
1808
|
-
return super.fromBER(inputBuffer, inputOffset, inputLength, context);
|
|
1809
|
-
}
|
|
1810
|
-
onAsciiEncoding() {
|
|
1811
|
-
if (this.valueBlock.isConstructed || (this.valueBlock.value && this.valueBlock.value.length)) {
|
|
1812
|
-
return Constructed.prototype.onAsciiEncoding.call(this);
|
|
1813
|
-
}
|
|
1814
|
-
const name = this.constructor.NAME;
|
|
1815
|
-
const value = pvtsutils__namespace.Convert.ToHex(this.valueBlock.valueHexView);
|
|
1816
|
-
return `${name} : ${value}`;
|
|
1817
|
-
}
|
|
1818
|
-
getValue() {
|
|
1819
|
-
if (!this.idBlock.isConstructed) {
|
|
1820
|
-
return this.valueBlock.valueHexView.slice().buffer;
|
|
1821
|
-
}
|
|
1822
|
-
const array = [];
|
|
1823
|
-
for (const content of this.valueBlock.value) {
|
|
1824
|
-
if (content instanceof _a$r) {
|
|
1825
|
-
array.push(content.valueBlock.valueHexView);
|
|
1826
|
-
}
|
|
1827
|
-
}
|
|
1828
|
-
return pvtsutils__namespace.BufferSourceConverter.concat(array);
|
|
1829
|
-
}
|
|
1830
|
-
}
|
|
1831
|
-
_a$r = OctetString;
|
|
1832
|
-
(() => {
|
|
1833
|
-
typeStore.OctetString = _a$r;
|
|
1834
|
-
})();
|
|
1835
|
-
OctetString.NAME = OCTET_STRING_NAME;
|
|
1836
|
-
|
|
1837
|
-
class LocalBitStringValueBlock extends HexBlock(LocalConstructedValueBlock) {
|
|
1838
|
-
constructor({ unusedBits = 0, isConstructed = false, ...parameters } = {}) {
|
|
1839
|
-
super(parameters);
|
|
1840
|
-
this.unusedBits = unusedBits;
|
|
1841
|
-
this.isConstructed = isConstructed;
|
|
1842
|
-
this.blockLength = this.valueHexView.byteLength;
|
|
1843
|
-
}
|
|
1844
|
-
fromBER(inputBuffer, inputOffset, inputLength, context) {
|
|
1845
|
-
if (!inputLength) {
|
|
1846
|
-
return inputOffset;
|
|
1847
|
-
}
|
|
1848
|
-
let resultOffset = -1;
|
|
1849
|
-
if (this.isConstructed) {
|
|
1850
|
-
resultOffset = LocalConstructedValueBlock.prototype.fromBER.call(this, inputBuffer, inputOffset, inputLength, context);
|
|
1851
|
-
if (resultOffset === -1)
|
|
1852
|
-
return resultOffset;
|
|
1853
|
-
for (const value of this.value) {
|
|
1854
|
-
const currentBlockName = value.constructor.NAME;
|
|
1855
|
-
if (currentBlockName === END_OF_CONTENT_NAME) {
|
|
1856
|
-
if (this.isIndefiniteForm)
|
|
1857
|
-
break;
|
|
1858
|
-
else {
|
|
1859
|
-
this.error = "EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only";
|
|
1860
|
-
return -1;
|
|
1861
|
-
}
|
|
1862
|
-
}
|
|
1863
|
-
if (currentBlockName !== BIT_STRING_NAME) {
|
|
1864
|
-
this.error = "BIT STRING may consists of BIT STRINGs only";
|
|
1865
|
-
return -1;
|
|
1866
|
-
}
|
|
1867
|
-
const valueBlock = value.valueBlock;
|
|
1868
|
-
if (this.unusedBits > 0 && valueBlock.unusedBits > 0) {
|
|
1869
|
-
this.error = 'Using of "unused bits" inside constructive BIT STRING allowed for least one only';
|
|
1870
|
-
return -1;
|
|
1871
|
-
}
|
|
1872
|
-
this.unusedBits = valueBlock.unusedBits;
|
|
1873
|
-
}
|
|
1874
|
-
return resultOffset;
|
|
1875
|
-
}
|
|
1876
|
-
const inputView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
1877
|
-
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
1878
|
-
return -1;
|
|
1879
|
-
}
|
|
1880
|
-
const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength);
|
|
1881
|
-
this.unusedBits = intBuffer[0];
|
|
1882
|
-
if (this.unusedBits > 7) {
|
|
1883
|
-
this.error = "Unused bits for BitString must be in range 0-7";
|
|
1884
|
-
return -1;
|
|
1885
|
-
}
|
|
1886
|
-
if (!this.unusedBits && (context === null || context === void 0 ? void 0 : context.parseEmbedded) !== false) {
|
|
1887
|
-
const buf = intBuffer.subarray(1);
|
|
1888
|
-
try {
|
|
1889
|
-
if (buf.byteLength) {
|
|
1890
|
-
const parseContext = context !== null && context !== void 0 ? context : createFromBerContext();
|
|
1891
|
-
const asn = localFromBERWithChildContext(buf, 0, buf.byteLength, parseContext);
|
|
1892
|
-
if (asn.offset !== -1 && asn.offset === inputLength - 1) {
|
|
1893
|
-
this.value = [asn.result];
|
|
1894
|
-
}
|
|
1895
|
-
}
|
|
1896
|
-
}
|
|
1897
|
-
catch {
|
|
1898
|
-
}
|
|
1899
|
-
}
|
|
1900
|
-
this.valueHexView = intBuffer.subarray(1);
|
|
1901
|
-
this.blockLength = intBuffer.length;
|
|
1902
|
-
return inputOffset + inputLength;
|
|
1903
|
-
}
|
|
1904
|
-
toBER(sizeOnly, writer) {
|
|
1905
|
-
if (this.isConstructed) {
|
|
1906
|
-
return LocalConstructedValueBlock.prototype.toBER.call(this, sizeOnly, writer);
|
|
1907
|
-
}
|
|
1908
|
-
if (sizeOnly) {
|
|
1909
|
-
return new ArrayBuffer(this.valueHexView.byteLength + 1);
|
|
1910
|
-
}
|
|
1911
|
-
if (!this.valueHexView.byteLength) {
|
|
1912
|
-
const empty = new Uint8Array(1);
|
|
1913
|
-
empty[0] = 0;
|
|
1914
|
-
return empty.buffer;
|
|
1915
|
-
}
|
|
1916
|
-
const retView = new Uint8Array(this.valueHexView.length + 1);
|
|
1917
|
-
retView[0] = this.unusedBits;
|
|
1918
|
-
retView.set(this.valueHexView, 1);
|
|
1919
|
-
return retView.buffer;
|
|
1920
|
-
}
|
|
1921
|
-
toJSON() {
|
|
1922
|
-
return {
|
|
1923
|
-
...super.toJSON(),
|
|
1924
|
-
unusedBits: this.unusedBits,
|
|
1925
|
-
isConstructed: this.isConstructed
|
|
1926
|
-
};
|
|
1927
|
-
}
|
|
1928
|
-
}
|
|
1929
|
-
LocalBitStringValueBlock.NAME = "BitStringValueBlock";
|
|
1930
|
-
const ORIGINAL_LOCAL_BIT_STRING_TO_BER = LocalBitStringValueBlock.prototype.toBER;
|
|
1931
|
-
|
|
1932
|
-
var _a$q;
|
|
1933
|
-
class BitString extends BaseBlock {
|
|
1934
|
-
constructor({ idBlock = {}, lenBlock = {}, ...parameters } = {}) {
|
|
1935
|
-
var _b, _c;
|
|
1936
|
-
(_b = parameters.isConstructed) !== null && _b !== void 0 ? _b : (parameters.isConstructed = !!((_c = parameters.value) === null || _c === void 0 ? void 0 : _c.length));
|
|
1937
|
-
super({
|
|
1938
|
-
idBlock: {
|
|
1939
|
-
isConstructed: parameters.isConstructed,
|
|
1940
|
-
...idBlock
|
|
1941
|
-
},
|
|
1942
|
-
lenBlock: {
|
|
1943
|
-
...lenBlock,
|
|
1944
|
-
isIndefiniteForm: !!parameters.isIndefiniteForm
|
|
1945
|
-
},
|
|
1946
|
-
...parameters
|
|
1947
|
-
}, LocalBitStringValueBlock);
|
|
1948
|
-
this.idBlock.tagClass = 1;
|
|
1949
|
-
this.idBlock.tagNumber = 3;
|
|
1950
|
-
}
|
|
1951
|
-
fromBER(inputBuffer, inputOffset, inputLength, context) {
|
|
1952
|
-
this.valueBlock.isConstructed = this.idBlock.isConstructed;
|
|
1953
|
-
this.valueBlock.isIndefiniteForm = this.lenBlock.isIndefiniteForm;
|
|
1954
|
-
return super.fromBER(inputBuffer, inputOffset, inputLength, context);
|
|
1955
|
-
}
|
|
1956
|
-
onAsciiEncoding() {
|
|
1957
|
-
if (this.valueBlock.isConstructed || (this.valueBlock.value && this.valueBlock.value.length)) {
|
|
1958
|
-
return Constructed.prototype.onAsciiEncoding.call(this);
|
|
1959
|
-
}
|
|
1960
|
-
else {
|
|
1961
|
-
const bits = [];
|
|
1962
|
-
const valueHex = this.valueBlock.valueHexView;
|
|
1963
|
-
for (const byte of valueHex) {
|
|
1964
|
-
bits.push(byte.toString(2).padStart(8, "0"));
|
|
1965
|
-
}
|
|
1966
|
-
const bitsStr = bits.join("");
|
|
1967
|
-
const name = this.constructor.NAME;
|
|
1968
|
-
const value = bitsStr.substring(0, bitsStr.length - this.valueBlock.unusedBits);
|
|
1969
|
-
return `${name} : ${value}`;
|
|
1970
|
-
}
|
|
1971
|
-
}
|
|
1972
|
-
}
|
|
1973
|
-
_a$q = BitString;
|
|
1974
|
-
(() => {
|
|
1975
|
-
typeStore.BitString = _a$q;
|
|
1976
|
-
})();
|
|
1977
|
-
BitString.NAME = BIT_STRING_NAME;
|
|
1978
|
-
|
|
1979
|
-
function bytesToSignedBigInt(view) {
|
|
1980
|
-
if (!view.byteLength)
|
|
1981
|
-
return BigInt(0);
|
|
1982
|
-
const value = BigInt(`0x${pvtsutils__namespace.Convert.ToHex(view)}`);
|
|
1983
|
-
if (view[0] & 0x80)
|
|
1984
|
-
return value - (BigInt(1) << BigInt(view.byteLength * 8));
|
|
1985
|
-
return value;
|
|
1986
|
-
}
|
|
1987
|
-
function bytesToSignedDecimal(view) {
|
|
1988
|
-
if (typeof BigInt !== "undefined")
|
|
1989
|
-
return bytesToSignedBigInt(view).toString(10);
|
|
1990
|
-
const BASE = 10000000;
|
|
1991
|
-
const DECIMAL_DIGITS = 7;
|
|
1992
|
-
if (!view.byteLength)
|
|
1993
|
-
return "0";
|
|
1994
|
-
const negative = !!(view[0] & 0x80);
|
|
1995
|
-
let magnitude = view;
|
|
1996
|
-
if (negative) {
|
|
1997
|
-
magnitude = new Uint8Array(view.length);
|
|
1998
|
-
let carry = 1;
|
|
1999
|
-
for (let i = view.length - 1; i >= 0; i--) {
|
|
2000
|
-
const value = (view[i] ^ 0xff) + carry;
|
|
2001
|
-
magnitude[i] = value & 0xff;
|
|
2002
|
-
carry = value >> 8;
|
|
2003
|
-
}
|
|
2004
|
-
}
|
|
2005
|
-
const limbs = [0];
|
|
2006
|
-
for (let index = 0; index < magnitude.length; index++) {
|
|
2007
|
-
let carry = magnitude[index];
|
|
2008
|
-
for (let i = 0; i < limbs.length; i++) {
|
|
2009
|
-
const value = limbs[i] * 256 + carry;
|
|
2010
|
-
limbs[i] = value % BASE;
|
|
2011
|
-
carry = Math.floor(value / BASE);
|
|
2012
|
-
}
|
|
2013
|
-
if (carry)
|
|
2014
|
-
limbs.push(carry);
|
|
2015
|
-
}
|
|
2016
|
-
let top = limbs.length - 1;
|
|
2017
|
-
while (top > 0 && limbs[top] === 0)
|
|
2018
|
-
top--;
|
|
2019
|
-
let result = String(limbs[top]);
|
|
2020
|
-
for (let i = top - 1; i >= 0; i--)
|
|
2021
|
-
result += String(limbs[i]).padStart(DECIMAL_DIGITS, "0");
|
|
2022
|
-
return negative && result !== "0" ? `-${result}` : result;
|
|
2023
|
-
}
|
|
2024
|
-
|
|
2025
|
-
var _a$p;
|
|
2026
|
-
class LocalIntegerValueBlock extends HexBlock(ValueBlock) {
|
|
2027
|
-
setValueHex() {
|
|
2028
|
-
if (this.valueHexView.length >= 4) {
|
|
2029
|
-
this.warnings.push("Too big Integer for decoding, hex only");
|
|
2030
|
-
this.isHexOnly = true;
|
|
2031
|
-
this._valueDec = 0;
|
|
2032
|
-
}
|
|
2033
|
-
else {
|
|
2034
|
-
this.isHexOnly = false;
|
|
2035
|
-
if (this.valueHexView.length > 0) {
|
|
2036
|
-
this._valueDec = pvutils__namespace.utilDecodeTC.call(this);
|
|
2037
|
-
}
|
|
2038
|
-
}
|
|
2039
|
-
}
|
|
2040
|
-
constructor({ value, ...parameters } = {}) {
|
|
2041
|
-
super(parameters);
|
|
2042
|
-
this._valueDec = 0;
|
|
2043
|
-
if (parameters.valueHex) {
|
|
2044
|
-
this.setValueHex();
|
|
2045
|
-
}
|
|
2046
|
-
if (value !== undefined) {
|
|
2047
|
-
this.valueDec = value;
|
|
2048
|
-
}
|
|
2049
|
-
}
|
|
2050
|
-
set valueDec(v) {
|
|
2051
|
-
this._valueDec = v;
|
|
2052
|
-
this.isHexOnly = false;
|
|
2053
|
-
this.valueHexView = new Uint8Array(pvutils__namespace.utilEncodeTC(v));
|
|
2054
|
-
}
|
|
2055
|
-
get valueDec() {
|
|
2056
|
-
return this._valueDec;
|
|
2057
|
-
}
|
|
2058
|
-
fromDER(inputBuffer, inputOffset, inputLength, expectedLength = 0) {
|
|
2059
|
-
const offset = this.fromBER(inputBuffer, inputOffset, inputLength);
|
|
2060
|
-
if (offset === -1)
|
|
2061
|
-
return offset;
|
|
2062
|
-
const view = this.valueHexView;
|
|
2063
|
-
if (view[0] === 0x00 && (view[1] & 0x80) !== 0) {
|
|
2064
|
-
this.valueHexView = view.subarray(1);
|
|
2065
|
-
}
|
|
2066
|
-
else {
|
|
2067
|
-
if (expectedLength !== 0) {
|
|
2068
|
-
if (view.length < expectedLength) {
|
|
2069
|
-
if (expectedLength - view.length > 1)
|
|
2070
|
-
expectedLength = view.length + 1;
|
|
2071
|
-
this.valueHexView = view.subarray(expectedLength - view.length);
|
|
2072
|
-
}
|
|
2073
|
-
}
|
|
2074
|
-
}
|
|
2075
|
-
return offset;
|
|
2076
|
-
}
|
|
2077
|
-
toDER(sizeOnly = false) {
|
|
2078
|
-
const view = this.valueHexView;
|
|
2079
|
-
switch (true) {
|
|
2080
|
-
case (view[0] & 0x80) !== 0:
|
|
2081
|
-
{
|
|
2082
|
-
const updatedView = new Uint8Array(this.valueHexView.length + 1);
|
|
2083
|
-
updatedView[0] = 0x00;
|
|
2084
|
-
updatedView.set(view, 1);
|
|
2085
|
-
this.valueHexView = updatedView;
|
|
2086
|
-
}
|
|
2087
|
-
break;
|
|
2088
|
-
case view[0] === 0x00 && (view[1] & 0x80) === 0:
|
|
2089
|
-
{
|
|
2090
|
-
this.valueHexView = this.valueHexView.subarray(1);
|
|
2091
|
-
}
|
|
2092
|
-
break;
|
|
2093
|
-
}
|
|
2094
|
-
return this.toBER(sizeOnly);
|
|
2095
|
-
}
|
|
2096
|
-
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
2097
|
-
const resultOffset = super.fromBER(inputBuffer, inputOffset, inputLength);
|
|
2098
|
-
if (resultOffset === -1) {
|
|
2099
|
-
return resultOffset;
|
|
2100
|
-
}
|
|
2101
|
-
this.setValueHex();
|
|
2102
|
-
return resultOffset;
|
|
2103
|
-
}
|
|
2104
|
-
toBER(sizeOnly) {
|
|
2105
|
-
return sizeOnly ? new ArrayBuffer(this.valueHexView.length) : this.valueHexView.slice().buffer;
|
|
2106
|
-
}
|
|
2107
|
-
toJSON() {
|
|
2108
|
-
return {
|
|
2109
|
-
...super.toJSON(),
|
|
2110
|
-
valueDec: this.valueDec
|
|
2111
|
-
};
|
|
2112
|
-
}
|
|
2113
|
-
toString() {
|
|
2114
|
-
return bytesToSignedDecimal(this.valueHexView);
|
|
2115
|
-
}
|
|
2116
|
-
}
|
|
2117
|
-
_a$p = LocalIntegerValueBlock;
|
|
2118
|
-
LocalIntegerValueBlock.NAME = "IntegerValueBlock";
|
|
2119
|
-
(() => {
|
|
2120
|
-
Object.defineProperty(_a$p.prototype, "valueHex", {
|
|
2121
|
-
set: function (v) {
|
|
2122
|
-
this.valueHexView = new Uint8Array(v);
|
|
2123
|
-
this.setValueHex();
|
|
2124
|
-
},
|
|
2125
|
-
get: function () {
|
|
2126
|
-
return this.valueHexView.slice().buffer;
|
|
2127
|
-
}
|
|
2128
|
-
});
|
|
2129
|
-
})();
|
|
2130
|
-
const ORIGINAL_LOCAL_INTEGER_TO_BER = LocalIntegerValueBlock.prototype.toBER;
|
|
2131
|
-
const ORIGINAL_LOCAL_INTEGER_TO_STRING = LocalIntegerValueBlock.prototype.toString;
|
|
2132
|
-
|
|
2133
|
-
var _a$o;
|
|
2134
|
-
class Integer extends BaseBlock {
|
|
2135
|
-
constructor(parameters = {}) {
|
|
2136
|
-
super(parameters, LocalIntegerValueBlock);
|
|
2137
|
-
this.idBlock.tagClass = 1;
|
|
2138
|
-
this.idBlock.tagNumber = 2;
|
|
2139
|
-
}
|
|
2140
|
-
toBigInt() {
|
|
2141
|
-
assertBigInt();
|
|
2142
|
-
const valueBlock = this.valueBlock;
|
|
2143
|
-
const toString = valueBlock.toString;
|
|
2144
|
-
if (toString === ORIGINAL_LOCAL_INTEGER_TO_STRING)
|
|
2145
|
-
return bytesToSignedBigInt(valueBlock.valueHexView);
|
|
2146
|
-
return BigInt(Reflect.apply(toString, valueBlock, []));
|
|
2147
|
-
}
|
|
2148
|
-
static fromBigInt(value) {
|
|
2149
|
-
assertBigInt();
|
|
2150
|
-
const bigIntValue = BigInt(value);
|
|
2151
|
-
const writer = new ViewWriter();
|
|
2152
|
-
const hex = bigIntValue.toString(16).replace(/^-/, "");
|
|
2153
|
-
const view = new Uint8Array(pvtsutils__namespace.Convert.FromHex(hex));
|
|
2154
|
-
if (bigIntValue < 0) {
|
|
2155
|
-
const first = new Uint8Array(view.length + (view[0] & 0x80 ? 1 : 0));
|
|
2156
|
-
first[0] |= 0x80;
|
|
2157
|
-
const firstInt = BigInt(`0x${pvtsutils__namespace.Convert.ToHex(first)}`);
|
|
2158
|
-
const secondInt = firstInt + bigIntValue;
|
|
2159
|
-
const second = pvtsutils__namespace.BufferSourceConverter.toUint8Array(pvtsutils__namespace.Convert.FromHex(secondInt.toString(16)));
|
|
2160
|
-
second[0] |= 0x80;
|
|
2161
|
-
writer.write(second);
|
|
2162
|
-
}
|
|
2163
|
-
else {
|
|
2164
|
-
if (view[0] & 0x80) {
|
|
2165
|
-
writer.write(new Uint8Array([0]));
|
|
2166
|
-
}
|
|
2167
|
-
writer.write(view);
|
|
2168
|
-
}
|
|
2169
|
-
const res = new _a$o({ valueHex: writer.final() });
|
|
2170
|
-
return res;
|
|
2171
|
-
}
|
|
2172
|
-
convertToDER() {
|
|
2173
|
-
const integer = new _a$o({ valueHex: this.valueBlock.valueHexView });
|
|
2174
|
-
integer.valueBlock.toDER();
|
|
2175
|
-
return integer;
|
|
2176
|
-
}
|
|
2177
|
-
convertFromDER() {
|
|
2178
|
-
return new _a$o({
|
|
2179
|
-
valueHex: this.valueBlock.valueHexView[0] === 0 ? this.valueBlock.valueHexView.subarray(1) : this.valueBlock.valueHexView
|
|
2180
|
-
});
|
|
2181
|
-
}
|
|
2182
|
-
onAsciiEncoding() {
|
|
2183
|
-
return `${this.constructor.NAME} : ${this.valueBlock.toString()}`;
|
|
2184
|
-
}
|
|
2185
|
-
}
|
|
2186
|
-
_a$o = Integer;
|
|
2187
|
-
(() => {
|
|
2188
|
-
typeStore.Integer = _a$o;
|
|
2189
|
-
})();
|
|
2190
|
-
Integer.NAME = "INTEGER";
|
|
2191
|
-
|
|
2192
|
-
var _a$n;
|
|
2193
|
-
class Enumerated extends Integer {
|
|
2194
|
-
constructor(parameters = {}) {
|
|
2195
|
-
super(parameters);
|
|
2196
|
-
this.idBlock.tagClass = 1;
|
|
2197
|
-
this.idBlock.tagNumber = 10;
|
|
2198
|
-
}
|
|
2199
|
-
}
|
|
2200
|
-
_a$n = Enumerated;
|
|
2201
|
-
(() => {
|
|
2202
|
-
typeStore.Enumerated = _a$n;
|
|
2203
|
-
})();
|
|
2204
|
-
Enumerated.NAME = "ENUMERATED";
|
|
2205
|
-
|
|
2206
|
-
class LocalSidValueBlock extends HexBlock(ValueBlock) {
|
|
2207
|
-
constructor({ valueDec = -1, isFirstSid = false, ...parameters } = {}) {
|
|
2208
|
-
super(parameters);
|
|
2209
|
-
this.valueDec = valueDec;
|
|
2210
|
-
this.isFirstSid = isFirstSid;
|
|
2211
|
-
}
|
|
2212
|
-
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
2213
|
-
if (!inputLength) {
|
|
2214
|
-
return inputOffset;
|
|
2215
|
-
}
|
|
2216
|
-
const inputView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
2217
|
-
if (!checkBufferParams(this, inputView, inputOffset, inputLength)) {
|
|
2218
|
-
return -1;
|
|
2219
|
-
}
|
|
2220
|
-
const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength);
|
|
2221
|
-
const fastPath = this.blockLength === 0 && Number.isInteger(inputOffset) && Number.isInteger(inputLength);
|
|
2222
|
-
if (fastPath) {
|
|
2223
|
-
let sidLength = 0;
|
|
2224
|
-
while (sidLength < inputLength) {
|
|
2225
|
-
const octet = intBuffer[sidLength];
|
|
2226
|
-
sidLength++;
|
|
2227
|
-
if ((octet & 0x80) === 0x00)
|
|
2228
|
-
break;
|
|
2229
|
-
}
|
|
2230
|
-
this.blockLength = sidLength;
|
|
2231
|
-
this.valueHexView = new Uint8Array(sidLength);
|
|
2232
|
-
for (let i = 0; i < sidLength; i++)
|
|
2233
|
-
this.valueHexView[i] = intBuffer[i] & 0x7f;
|
|
2234
|
-
}
|
|
2235
|
-
else {
|
|
2236
|
-
this.valueHexView = new Uint8Array(inputLength);
|
|
2237
|
-
for (let i = 0; i < inputLength; i++) {
|
|
2238
|
-
this.valueHexView[i] = intBuffer[i] & 0x7f;
|
|
2239
|
-
this.blockLength++;
|
|
2240
|
-
if ((intBuffer[i] & 0x80) === 0x00)
|
|
2241
|
-
break;
|
|
2242
|
-
}
|
|
2243
|
-
const tempView = new Uint8Array(this.blockLength);
|
|
2244
|
-
for (let i = 0; i < this.blockLength; i++) {
|
|
2245
|
-
tempView[i] = this.valueHexView[i];
|
|
2246
|
-
}
|
|
2247
|
-
this.valueHexView = tempView;
|
|
2248
|
-
}
|
|
2249
|
-
if ((intBuffer[this.blockLength - 1] & 0x80) !== 0x00) {
|
|
2250
|
-
this.error = "End of input reached before message was fully decoded";
|
|
2251
|
-
return -1;
|
|
2252
|
-
}
|
|
2253
|
-
if (this.valueHexView[0] === 0x00)
|
|
2254
|
-
this.warnings.push("Needlessly long format of SID encoding");
|
|
2255
|
-
if (this.blockLength <= 8)
|
|
2256
|
-
this.valueDec = pvutils__namespace.utilFromBase(this.valueHexView, 7);
|
|
2257
|
-
else {
|
|
2258
|
-
this.isHexOnly = true;
|
|
2259
|
-
this.warnings.push("Too big SID for decoding, hex only");
|
|
2260
|
-
}
|
|
2261
|
-
return inputOffset + this.blockLength;
|
|
2262
|
-
}
|
|
2263
|
-
set valueBigInt(value) {
|
|
2264
|
-
assertBigInt();
|
|
2265
|
-
let bits = BigInt(value).toString(2);
|
|
2266
|
-
while (bits.length % 7) {
|
|
2267
|
-
bits = "0" + bits;
|
|
2268
|
-
}
|
|
2269
|
-
const bytes = new Uint8Array(bits.length / 7);
|
|
2270
|
-
for (let i = 0; i < bytes.length; i++) {
|
|
2271
|
-
bytes[i] = parseInt(bits.slice(i * 7, i * 7 + 7), 2) + (i + 1 < bytes.length ? 0x80 : 0);
|
|
2272
|
-
}
|
|
2273
|
-
this.fromBER(bytes.buffer, 0, bytes.length);
|
|
2274
|
-
}
|
|
2275
|
-
toBER(sizeOnly) {
|
|
2276
|
-
if (this.isHexOnly) {
|
|
2277
|
-
if (sizeOnly)
|
|
2278
|
-
return new ArrayBuffer(this.valueHexView.byteLength);
|
|
2279
|
-
const curView = this.valueHexView;
|
|
2280
|
-
const retView = new Uint8Array(this.blockLength);
|
|
2281
|
-
for (let i = 0; i < this.blockLength - 1; i++)
|
|
2282
|
-
retView[i] = curView[i] | 0x80;
|
|
2283
|
-
retView[this.blockLength - 1] = curView[this.blockLength - 1];
|
|
2284
|
-
return pvtsutils__namespace.BufferSourceConverter.toArrayBuffer(retView);
|
|
2285
|
-
}
|
|
2286
|
-
const encodedBuf = pvutils__namespace.utilToBase(this.valueDec, 7);
|
|
2287
|
-
if (encodedBuf.byteLength === 0) {
|
|
2288
|
-
this.error = "Error during encoding SID value";
|
|
2289
|
-
return EMPTY_BUFFER;
|
|
2290
|
-
}
|
|
2291
|
-
const retView = new Uint8Array(encodedBuf.byteLength);
|
|
2292
|
-
if (!sizeOnly) {
|
|
2293
|
-
const encodedView = new Uint8Array(encodedBuf);
|
|
2294
|
-
const len = encodedBuf.byteLength - 1;
|
|
2295
|
-
for (let i = 0; i < len; i++)
|
|
2296
|
-
retView[i] = encodedView[i] | 0x80;
|
|
2297
|
-
retView[len] = encodedView[len];
|
|
2298
|
-
}
|
|
2299
|
-
return pvtsutils__namespace.BufferSourceConverter.toArrayBuffer(retView);
|
|
2300
|
-
}
|
|
2301
|
-
toString() {
|
|
2302
|
-
let result = "";
|
|
2303
|
-
if (this.isHexOnly)
|
|
2304
|
-
result = pvtsutils__namespace.Convert.ToHex(this.valueHexView);
|
|
2305
|
-
else {
|
|
2306
|
-
if (this.isFirstSid) {
|
|
2307
|
-
let sidValue = this.valueDec;
|
|
2308
|
-
if (this.valueDec <= 39)
|
|
2309
|
-
result = "0.";
|
|
2310
|
-
else {
|
|
2311
|
-
if (this.valueDec <= 79) {
|
|
2312
|
-
result = "1.";
|
|
2313
|
-
sidValue -= 40;
|
|
2314
|
-
}
|
|
2315
|
-
else {
|
|
2316
|
-
result = "2.";
|
|
2317
|
-
sidValue -= 80;
|
|
2318
|
-
}
|
|
2319
|
-
}
|
|
2320
|
-
result += sidValue.toString();
|
|
2321
|
-
}
|
|
2322
|
-
else
|
|
2323
|
-
result = this.valueDec.toString();
|
|
2324
|
-
}
|
|
2325
|
-
return result;
|
|
2326
|
-
}
|
|
2327
|
-
toJSON() {
|
|
2328
|
-
return {
|
|
2329
|
-
...super.toJSON(),
|
|
2330
|
-
valueDec: this.valueDec,
|
|
2331
|
-
isFirstSid: this.isFirstSid
|
|
2332
|
-
};
|
|
2333
|
-
}
|
|
2334
|
-
}
|
|
2335
|
-
LocalSidValueBlock.NAME = "sidBlock";
|
|
2336
|
-
|
|
2337
|
-
class LocalObjectIdentifierValueBlock extends ValueBlock {
|
|
2338
|
-
constructor({ value = EMPTY_STRING, ...parameters } = {}) {
|
|
2339
|
-
super(parameters);
|
|
2340
|
-
this.value = [];
|
|
2341
|
-
if (value) {
|
|
2342
|
-
this.fromString(value);
|
|
2343
|
-
}
|
|
2344
|
-
}
|
|
2345
|
-
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
2346
|
-
let resultOffset = inputOffset;
|
|
2347
|
-
while (inputLength > 0) {
|
|
2348
|
-
const sidBlock = new LocalSidValueBlock();
|
|
2349
|
-
resultOffset = sidBlock.fromBER(inputBuffer, resultOffset, inputLength);
|
|
2350
|
-
if (resultOffset === -1) {
|
|
2351
|
-
this.blockLength = 0;
|
|
2352
|
-
this.error = sidBlock.error;
|
|
2353
|
-
return resultOffset;
|
|
2354
|
-
}
|
|
2355
|
-
if (this.value.length === 0)
|
|
2356
|
-
sidBlock.isFirstSid = true;
|
|
2357
|
-
this.blockLength += sidBlock.blockLength;
|
|
2358
|
-
inputLength -= sidBlock.blockLength;
|
|
2359
|
-
this.value.push(sidBlock);
|
|
2360
|
-
}
|
|
2361
|
-
return resultOffset;
|
|
2362
|
-
}
|
|
2363
|
-
toBER(sizeOnly) {
|
|
2364
|
-
const retBuffers = [];
|
|
2365
|
-
for (let i = 0; i < this.value.length; i++) {
|
|
2366
|
-
const valueBuf = this.value[i].toBER(sizeOnly);
|
|
2367
|
-
if (valueBuf.byteLength === 0) {
|
|
2368
|
-
this.error = this.value[i].error;
|
|
2369
|
-
return EMPTY_BUFFER;
|
|
2370
|
-
}
|
|
2371
|
-
retBuffers.push(valueBuf);
|
|
2372
|
-
}
|
|
2373
|
-
return concat(retBuffers);
|
|
2374
|
-
}
|
|
2375
|
-
fromString(string) {
|
|
2376
|
-
this.value = [];
|
|
2377
|
-
let pos1 = 0;
|
|
2378
|
-
let pos2 = 0;
|
|
2379
|
-
let sid = "";
|
|
2380
|
-
let flag = false;
|
|
2381
|
-
do {
|
|
2382
|
-
pos2 = string.indexOf(".", pos1);
|
|
2383
|
-
if (pos2 === -1)
|
|
2384
|
-
sid = string.substring(pos1);
|
|
2385
|
-
else
|
|
2386
|
-
sid = string.substring(pos1, pos2);
|
|
2387
|
-
pos1 = pos2 + 1;
|
|
2388
|
-
if (flag) {
|
|
2389
|
-
const sidBlock = this.value[0];
|
|
2390
|
-
let plus = 0;
|
|
2391
|
-
switch (sidBlock.valueDec) {
|
|
2392
|
-
case 0:
|
|
2393
|
-
break;
|
|
2394
|
-
case 1:
|
|
2395
|
-
plus = 40;
|
|
2396
|
-
break;
|
|
2397
|
-
case 2:
|
|
2398
|
-
plus = 80;
|
|
2399
|
-
break;
|
|
2400
|
-
default:
|
|
2401
|
-
this.value = [];
|
|
2402
|
-
return;
|
|
2403
|
-
}
|
|
2404
|
-
const parsedSID = parseInt(sid, 10);
|
|
2405
|
-
if (isNaN(parsedSID))
|
|
2406
|
-
return;
|
|
2407
|
-
sidBlock.valueDec = parsedSID + plus;
|
|
2408
|
-
flag = false;
|
|
2409
|
-
}
|
|
2410
|
-
else {
|
|
2411
|
-
const sidBlock = new LocalSidValueBlock();
|
|
2412
|
-
if (sid > Number.MAX_SAFE_INTEGER) {
|
|
2413
|
-
assertBigInt();
|
|
2414
|
-
const sidValue = BigInt(sid);
|
|
2415
|
-
sidBlock.valueBigInt = sidValue;
|
|
2416
|
-
}
|
|
2417
|
-
else {
|
|
2418
|
-
sidBlock.valueDec = parseInt(sid, 10);
|
|
2419
|
-
if (isNaN(sidBlock.valueDec))
|
|
2420
|
-
return;
|
|
2421
|
-
}
|
|
2422
|
-
if (!this.value.length) {
|
|
2423
|
-
sidBlock.isFirstSid = true;
|
|
2424
|
-
flag = true;
|
|
2425
|
-
}
|
|
2426
|
-
this.value.push(sidBlock);
|
|
2427
|
-
}
|
|
2428
|
-
} while (pos2 !== -1);
|
|
2429
|
-
}
|
|
2430
|
-
toString() {
|
|
2431
|
-
let result = "";
|
|
2432
|
-
let isHexOnly = false;
|
|
2433
|
-
for (let i = 0; i < this.value.length; i++) {
|
|
2434
|
-
isHexOnly = this.value[i].isHexOnly;
|
|
2435
|
-
let sidStr = this.value[i].toString();
|
|
2436
|
-
if (i !== 0)
|
|
2437
|
-
result = `${result}.`;
|
|
2438
|
-
if (isHexOnly) {
|
|
2439
|
-
sidStr = `{${sidStr}}`;
|
|
2440
|
-
if (this.value[i].isFirstSid)
|
|
2441
|
-
result = `2.{${sidStr} - 80}`;
|
|
2442
|
-
else
|
|
2443
|
-
result += sidStr;
|
|
2444
|
-
}
|
|
2445
|
-
else
|
|
2446
|
-
result += sidStr;
|
|
2447
|
-
}
|
|
2448
|
-
return result;
|
|
2449
|
-
}
|
|
2450
|
-
toJSON() {
|
|
2451
|
-
const object = {
|
|
2452
|
-
...super.toJSON(),
|
|
2453
|
-
value: this.toString(),
|
|
2454
|
-
sidArray: []
|
|
2455
|
-
};
|
|
2456
|
-
for (let i = 0; i < this.value.length; i++) {
|
|
2457
|
-
object.sidArray.push(this.value[i].toJSON());
|
|
2458
|
-
}
|
|
2459
|
-
return object;
|
|
2460
|
-
}
|
|
2461
|
-
}
|
|
2462
|
-
LocalObjectIdentifierValueBlock.NAME = "ObjectIdentifierValueBlock";
|
|
2463
|
-
|
|
2464
|
-
var _a$m;
|
|
2465
|
-
class ObjectIdentifier extends BaseBlock {
|
|
2466
|
-
getValue() {
|
|
2467
|
-
return this.valueBlock.toString();
|
|
2468
|
-
}
|
|
2469
|
-
setValue(value) {
|
|
2470
|
-
this.valueBlock.fromString(value);
|
|
2471
|
-
}
|
|
2472
|
-
constructor(parameters = {}) {
|
|
2473
|
-
super(parameters, LocalObjectIdentifierValueBlock);
|
|
2474
|
-
this.idBlock.tagClass = 1;
|
|
2475
|
-
this.idBlock.tagNumber = 6;
|
|
2476
|
-
}
|
|
2477
|
-
onAsciiEncoding() {
|
|
2478
|
-
return `${this.constructor.NAME} : ${this.valueBlock.toString() || "empty"}`;
|
|
2479
|
-
}
|
|
2480
|
-
toJSON() {
|
|
2481
|
-
return {
|
|
2482
|
-
...super.toJSON(),
|
|
2483
|
-
value: this.getValue()
|
|
2484
|
-
};
|
|
2485
|
-
}
|
|
2486
|
-
}
|
|
2487
|
-
_a$m = ObjectIdentifier;
|
|
2488
|
-
(() => {
|
|
2489
|
-
typeStore.ObjectIdentifier = _a$m;
|
|
2490
|
-
})();
|
|
2491
|
-
ObjectIdentifier.NAME = "OBJECT IDENTIFIER";
|
|
2492
|
-
|
|
2493
|
-
class LocalRelativeSidValueBlock extends HexBlock(LocalBaseBlock) {
|
|
2494
|
-
constructor({ valueDec = 0, ...parameters } = {}) {
|
|
2495
|
-
super(parameters);
|
|
2496
|
-
this.valueDec = valueDec;
|
|
2497
|
-
}
|
|
2498
|
-
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
2499
|
-
if (inputLength === 0)
|
|
2500
|
-
return inputOffset;
|
|
2501
|
-
const inputView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
2502
|
-
if (!checkBufferParams(this, inputView, inputOffset, inputLength))
|
|
2503
|
-
return -1;
|
|
2504
|
-
const intBuffer = inputView.subarray(inputOffset, inputOffset + inputLength);
|
|
2505
|
-
const fastPath = this.blockLength === 0 && Number.isInteger(inputOffset) && Number.isInteger(inputLength);
|
|
2506
|
-
if (fastPath) {
|
|
2507
|
-
let sidLength = 0;
|
|
2508
|
-
while (sidLength < inputLength) {
|
|
2509
|
-
const octet = intBuffer[sidLength];
|
|
2510
|
-
sidLength++;
|
|
2511
|
-
if ((octet & 0x80) === 0x00)
|
|
2512
|
-
break;
|
|
2513
|
-
}
|
|
2514
|
-
this.blockLength = sidLength;
|
|
2515
|
-
this.valueHexView = new Uint8Array(sidLength);
|
|
2516
|
-
for (let i = 0; i < sidLength; i++)
|
|
2517
|
-
this.valueHexView[i] = intBuffer[i] & 0x7f;
|
|
2518
|
-
}
|
|
2519
|
-
else {
|
|
2520
|
-
this.valueHexView = new Uint8Array(inputLength);
|
|
2521
|
-
for (let i = 0; i < inputLength; i++) {
|
|
2522
|
-
this.valueHexView[i] = intBuffer[i] & 0x7f;
|
|
2523
|
-
this.blockLength++;
|
|
2524
|
-
if ((intBuffer[i] & 0x80) === 0x00)
|
|
2525
|
-
break;
|
|
2526
|
-
}
|
|
2527
|
-
const tempView = new Uint8Array(this.blockLength);
|
|
2528
|
-
for (let i = 0; i < this.blockLength; i++)
|
|
2529
|
-
tempView[i] = this.valueHexView[i];
|
|
2530
|
-
this.valueHexView = tempView;
|
|
2531
|
-
}
|
|
2532
|
-
if ((intBuffer[this.blockLength - 1] & 0x80) !== 0x00) {
|
|
2533
|
-
this.error = "End of input reached before message was fully decoded";
|
|
2534
|
-
return -1;
|
|
2535
|
-
}
|
|
2536
|
-
if (this.valueHexView[0] === 0x00)
|
|
2537
|
-
this.warnings.push("Needlessly long format of SID encoding");
|
|
2538
|
-
if (this.blockLength <= 8)
|
|
2539
|
-
this.valueDec = pvutils__namespace.utilFromBase(this.valueHexView, 7);
|
|
2540
|
-
else {
|
|
2541
|
-
this.isHexOnly = true;
|
|
2542
|
-
this.warnings.push("Too big SID for decoding, hex only");
|
|
2543
|
-
}
|
|
2544
|
-
return inputOffset + this.blockLength;
|
|
2545
|
-
}
|
|
2546
|
-
toBER(sizeOnly) {
|
|
2547
|
-
if (this.isHexOnly) {
|
|
2548
|
-
if (sizeOnly)
|
|
2549
|
-
return new ArrayBuffer(this.valueHexView.byteLength);
|
|
2550
|
-
const curView = this.valueHexView;
|
|
2551
|
-
const retView = new Uint8Array(this.blockLength);
|
|
2552
|
-
for (let i = 0; i < this.blockLength - 1; i++)
|
|
2553
|
-
retView[i] = curView[i] | 0x80;
|
|
2554
|
-
retView[this.blockLength - 1] = curView[this.blockLength - 1];
|
|
2555
|
-
return retView.buffer;
|
|
2556
|
-
}
|
|
2557
|
-
const encodedBuf = pvutils__namespace.utilToBase(this.valueDec, 7);
|
|
2558
|
-
if (encodedBuf.byteLength === 0) {
|
|
2559
|
-
this.error = "Error during encoding SID value";
|
|
2560
|
-
return EMPTY_BUFFER;
|
|
2561
|
-
}
|
|
2562
|
-
const retView = new Uint8Array(encodedBuf.byteLength);
|
|
2563
|
-
if (!sizeOnly) {
|
|
2564
|
-
const encodedView = new Uint8Array(encodedBuf);
|
|
2565
|
-
const len = encodedBuf.byteLength - 1;
|
|
2566
|
-
for (let i = 0; i < len; i++)
|
|
2567
|
-
retView[i] = encodedView[i] | 0x80;
|
|
2568
|
-
retView[len] = encodedView[len];
|
|
2569
|
-
}
|
|
2570
|
-
return retView.buffer;
|
|
2571
|
-
}
|
|
2572
|
-
toString() {
|
|
2573
|
-
let result = "";
|
|
2574
|
-
if (this.isHexOnly)
|
|
2575
|
-
result = pvtsutils__namespace.Convert.ToHex(this.valueHexView);
|
|
2576
|
-
else {
|
|
2577
|
-
result = this.valueDec.toString();
|
|
2578
|
-
}
|
|
2579
|
-
return result;
|
|
2580
|
-
}
|
|
2581
|
-
toJSON() {
|
|
2582
|
-
return {
|
|
2583
|
-
...super.toJSON(),
|
|
2584
|
-
valueDec: this.valueDec
|
|
2585
|
-
};
|
|
2586
|
-
}
|
|
2587
|
-
}
|
|
2588
|
-
LocalRelativeSidValueBlock.NAME = "relativeSidBlock";
|
|
2589
|
-
|
|
2590
|
-
class LocalRelativeObjectIdentifierValueBlock extends ValueBlock {
|
|
2591
|
-
constructor({ value = EMPTY_STRING, ...parameters } = {}) {
|
|
2592
|
-
super(parameters);
|
|
2593
|
-
this.value = [];
|
|
2594
|
-
if (value) {
|
|
2595
|
-
this.fromString(value);
|
|
2596
|
-
}
|
|
2597
|
-
}
|
|
2598
|
-
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
2599
|
-
let resultOffset = inputOffset;
|
|
2600
|
-
while (inputLength > 0) {
|
|
2601
|
-
const sidBlock = new LocalRelativeSidValueBlock();
|
|
2602
|
-
resultOffset = sidBlock.fromBER(inputBuffer, resultOffset, inputLength);
|
|
2603
|
-
if (resultOffset === -1) {
|
|
2604
|
-
this.blockLength = 0;
|
|
2605
|
-
this.error = sidBlock.error;
|
|
2606
|
-
return resultOffset;
|
|
2607
|
-
}
|
|
2608
|
-
this.blockLength += sidBlock.blockLength;
|
|
2609
|
-
inputLength -= sidBlock.blockLength;
|
|
2610
|
-
this.value.push(sidBlock);
|
|
2611
|
-
}
|
|
2612
|
-
return resultOffset;
|
|
2613
|
-
}
|
|
2614
|
-
toBER(sizeOnly, _writer) {
|
|
2615
|
-
const retBuffers = [];
|
|
2616
|
-
for (let i = 0; i < this.value.length; i++) {
|
|
2617
|
-
const valueBuf = this.value[i].toBER(sizeOnly);
|
|
2618
|
-
if (valueBuf.byteLength === 0) {
|
|
2619
|
-
this.error = this.value[i].error;
|
|
2620
|
-
return EMPTY_BUFFER;
|
|
2621
|
-
}
|
|
2622
|
-
retBuffers.push(valueBuf);
|
|
2623
|
-
}
|
|
2624
|
-
return concat(retBuffers);
|
|
2625
|
-
}
|
|
2626
|
-
fromString(string) {
|
|
2627
|
-
this.value = [];
|
|
2628
|
-
let pos1 = 0;
|
|
2629
|
-
let pos2 = 0;
|
|
2630
|
-
let sid = "";
|
|
2631
|
-
do {
|
|
2632
|
-
pos2 = string.indexOf(".", pos1);
|
|
2633
|
-
if (pos2 === -1)
|
|
2634
|
-
sid = string.substring(pos1);
|
|
2635
|
-
else
|
|
2636
|
-
sid = string.substring(pos1, pos2);
|
|
2637
|
-
pos1 = pos2 + 1;
|
|
2638
|
-
const sidBlock = new LocalRelativeSidValueBlock();
|
|
2639
|
-
sidBlock.valueDec = parseInt(sid, 10);
|
|
2640
|
-
if (isNaN(sidBlock.valueDec))
|
|
2641
|
-
return true;
|
|
2642
|
-
this.value.push(sidBlock);
|
|
2643
|
-
} while (pos2 !== -1);
|
|
2644
|
-
return true;
|
|
2645
|
-
}
|
|
2646
|
-
toString() {
|
|
2647
|
-
let result = "";
|
|
2648
|
-
let isHexOnly = false;
|
|
2649
|
-
for (let i = 0; i < this.value.length; i++) {
|
|
2650
|
-
isHexOnly = this.value[i].isHexOnly;
|
|
2651
|
-
let sidStr = this.value[i].toString();
|
|
2652
|
-
if (i !== 0)
|
|
2653
|
-
result = `${result}.`;
|
|
2654
|
-
if (isHexOnly) {
|
|
2655
|
-
sidStr = `{${sidStr}}`;
|
|
2656
|
-
result += sidStr;
|
|
2657
|
-
}
|
|
2658
|
-
else
|
|
2659
|
-
result += sidStr;
|
|
2660
|
-
}
|
|
2661
|
-
return result;
|
|
2662
|
-
}
|
|
2663
|
-
toJSON() {
|
|
2664
|
-
const object = {
|
|
2665
|
-
...super.toJSON(),
|
|
2666
|
-
value: this.toString(),
|
|
2667
|
-
sidArray: []
|
|
2668
|
-
};
|
|
2669
|
-
for (let i = 0; i < this.value.length; i++)
|
|
2670
|
-
object.sidArray.push(this.value[i].toJSON());
|
|
2671
|
-
return object;
|
|
2672
|
-
}
|
|
2673
|
-
}
|
|
2674
|
-
LocalRelativeObjectIdentifierValueBlock.NAME = "RelativeObjectIdentifierValueBlock";
|
|
2675
|
-
|
|
2676
|
-
var _a$l;
|
|
2677
|
-
class RelativeObjectIdentifier extends BaseBlock {
|
|
2678
|
-
getValue() {
|
|
2679
|
-
return this.valueBlock.toString();
|
|
2680
|
-
}
|
|
2681
|
-
setValue(value) {
|
|
2682
|
-
this.valueBlock.fromString(value);
|
|
2683
|
-
}
|
|
2684
|
-
constructor(parameters = {}) {
|
|
2685
|
-
super(parameters, LocalRelativeObjectIdentifierValueBlock);
|
|
2686
|
-
this.idBlock.tagClass = 1;
|
|
2687
|
-
this.idBlock.tagNumber = 13;
|
|
2688
|
-
}
|
|
2689
|
-
onAsciiEncoding() {
|
|
2690
|
-
return `${this.constructor.NAME} : ${this.valueBlock.toString() || "empty"}`;
|
|
2691
|
-
}
|
|
2692
|
-
toJSON() {
|
|
2693
|
-
return {
|
|
2694
|
-
...super.toJSON(),
|
|
2695
|
-
value: this.getValue()
|
|
2696
|
-
};
|
|
2697
|
-
}
|
|
2698
|
-
}
|
|
2699
|
-
_a$l = RelativeObjectIdentifier;
|
|
2700
|
-
(() => {
|
|
2701
|
-
typeStore.RelativeObjectIdentifier = _a$l;
|
|
2702
|
-
})();
|
|
2703
|
-
RelativeObjectIdentifier.NAME = "RelativeObjectIdentifier";
|
|
2704
|
-
|
|
2705
|
-
var _a$k;
|
|
2706
|
-
class Sequence extends Constructed {
|
|
2707
|
-
constructor(parameters = {}) {
|
|
2708
|
-
super(parameters);
|
|
2709
|
-
this.idBlock.tagClass = 1;
|
|
2710
|
-
this.idBlock.tagNumber = 16;
|
|
2711
|
-
}
|
|
2712
|
-
}
|
|
2713
|
-
_a$k = Sequence;
|
|
2714
|
-
(() => {
|
|
2715
|
-
typeStore.Sequence = _a$k;
|
|
2716
|
-
})();
|
|
2717
|
-
Sequence.NAME = "SEQUENCE";
|
|
2718
|
-
|
|
2719
|
-
var _a$j;
|
|
2720
|
-
class Set extends Constructed {
|
|
2721
|
-
constructor(parameters = {}) {
|
|
2722
|
-
super(parameters);
|
|
2723
|
-
this.idBlock.tagClass = 1;
|
|
2724
|
-
this.idBlock.tagNumber = 17;
|
|
2725
|
-
}
|
|
2726
|
-
}
|
|
2727
|
-
_a$j = Set;
|
|
2728
|
-
(() => {
|
|
2729
|
-
typeStore.Set = _a$j;
|
|
2730
|
-
})();
|
|
2731
|
-
Set.NAME = "SET";
|
|
2732
|
-
|
|
2733
|
-
class LocalStringValueBlock extends HexBlock(ValueBlock) {
|
|
2734
|
-
constructor({ ...parameters } = {}) {
|
|
2735
|
-
super(parameters);
|
|
2736
|
-
this.isHexOnly = true;
|
|
2737
|
-
this.value = EMPTY_STRING;
|
|
2738
|
-
}
|
|
2739
|
-
toJSON() {
|
|
2740
|
-
return {
|
|
2741
|
-
...super.toJSON(),
|
|
2742
|
-
value: this.value
|
|
2743
|
-
};
|
|
2744
|
-
}
|
|
2745
|
-
}
|
|
2746
|
-
LocalStringValueBlock.NAME = "StringValueBlock";
|
|
2747
|
-
|
|
2748
|
-
class LocalSimpleStringValueBlock extends LocalStringValueBlock {
|
|
2749
|
-
}
|
|
2750
|
-
LocalSimpleStringValueBlock.NAME = "SimpleStringValueBlock";
|
|
2751
|
-
|
|
2752
|
-
class LocalSimpleStringBlock extends BaseStringBlock {
|
|
2753
|
-
constructor({ ...parameters } = {}) {
|
|
2754
|
-
super(parameters, LocalSimpleStringValueBlock);
|
|
2755
|
-
}
|
|
2756
|
-
fromBuffer(inputBuffer) {
|
|
2757
|
-
this.valueBlock.value = String.fromCharCode.apply(null, pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer));
|
|
2758
|
-
}
|
|
2759
|
-
fromString(inputString) {
|
|
2760
|
-
const strLen = inputString.length;
|
|
2761
|
-
const view = (this.valueBlock.valueHexView = new Uint8Array(strLen));
|
|
2762
|
-
for (let i = 0; i < strLen; i++)
|
|
2763
|
-
view[i] = inputString.charCodeAt(i);
|
|
2764
|
-
this.valueBlock.value = inputString;
|
|
2765
|
-
}
|
|
2766
|
-
}
|
|
2767
|
-
LocalSimpleStringBlock.NAME = "SIMPLE STRING";
|
|
2768
|
-
|
|
2769
|
-
class LocalUtf8StringValueBlock extends LocalSimpleStringBlock {
|
|
2770
|
-
fromBuffer(inputBuffer) {
|
|
2771
|
-
this.valueBlock.valueHexView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
2772
|
-
try {
|
|
2773
|
-
this.valueBlock.value = pvtsutils__namespace.Convert.ToUtf8String(inputBuffer);
|
|
2774
|
-
}
|
|
2775
|
-
catch (ex) {
|
|
2776
|
-
this.warnings.push(`Error during "decodeURIComponent": ${ex}, using raw string`);
|
|
2777
|
-
this.valueBlock.value = pvtsutils__namespace.Convert.ToBinary(inputBuffer);
|
|
2778
|
-
}
|
|
2779
|
-
}
|
|
2780
|
-
fromString(inputString) {
|
|
2781
|
-
this.valueBlock.valueHexView = new Uint8Array(pvtsutils__namespace.Convert.FromUtf8String(inputString));
|
|
2782
|
-
this.valueBlock.value = inputString;
|
|
2783
|
-
}
|
|
2784
|
-
}
|
|
2785
|
-
LocalUtf8StringValueBlock.NAME = "Utf8StringValueBlock";
|
|
2786
|
-
|
|
2787
|
-
var _a$i;
|
|
2788
|
-
class Utf8String extends LocalUtf8StringValueBlock {
|
|
2789
|
-
constructor(parameters = {}) {
|
|
2790
|
-
super(parameters);
|
|
2791
|
-
this.idBlock.tagClass = 1;
|
|
2792
|
-
this.idBlock.tagNumber = 12;
|
|
2793
|
-
}
|
|
2794
|
-
}
|
|
2795
|
-
_a$i = Utf8String;
|
|
2796
|
-
(() => {
|
|
2797
|
-
typeStore.Utf8String = _a$i;
|
|
2798
|
-
})();
|
|
2799
|
-
Utf8String.NAME = "UTF8String";
|
|
2800
|
-
|
|
2801
|
-
class LocalBmpStringValueBlock extends LocalSimpleStringBlock {
|
|
2802
|
-
fromBuffer(inputBuffer) {
|
|
2803
|
-
this.valueBlock.value = pvtsutils__namespace.Convert.ToUtf16String(inputBuffer);
|
|
2804
|
-
this.valueBlock.valueHexView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer);
|
|
2805
|
-
}
|
|
2806
|
-
fromString(inputString) {
|
|
2807
|
-
this.valueBlock.value = inputString;
|
|
2808
|
-
this.valueBlock.valueHexView = new Uint8Array(pvtsutils__namespace.Convert.FromUtf16String(inputString));
|
|
2809
|
-
}
|
|
2810
|
-
}
|
|
2811
|
-
LocalBmpStringValueBlock.NAME = "BmpStringValueBlock";
|
|
2812
|
-
|
|
2813
|
-
var _a$h;
|
|
2814
|
-
class BmpString extends LocalBmpStringValueBlock {
|
|
2815
|
-
constructor({ ...parameters } = {}) {
|
|
2816
|
-
super(parameters);
|
|
2817
|
-
this.idBlock.tagClass = 1;
|
|
2818
|
-
this.idBlock.tagNumber = 30;
|
|
2819
|
-
}
|
|
2820
|
-
}
|
|
2821
|
-
_a$h = BmpString;
|
|
2822
|
-
(() => {
|
|
2823
|
-
typeStore.BmpString = _a$h;
|
|
2824
|
-
})();
|
|
2825
|
-
BmpString.NAME = "BMPString";
|
|
2826
|
-
|
|
2827
|
-
class LocalUniversalStringValueBlock extends LocalSimpleStringBlock {
|
|
2828
|
-
fromBuffer(inputBuffer) {
|
|
2829
|
-
const copyBuffer = ArrayBuffer.isView(inputBuffer) ? inputBuffer.slice().buffer : inputBuffer.slice(0);
|
|
2830
|
-
const valueView = new Uint8Array(copyBuffer);
|
|
2831
|
-
for (let i = 0; i < valueView.length; i += 4) {
|
|
2832
|
-
valueView[i] = valueView[i + 3];
|
|
2833
|
-
valueView[i + 1] = valueView[i + 2];
|
|
2834
|
-
valueView[i + 2] = 0x00;
|
|
2835
|
-
valueView[i + 3] = 0x00;
|
|
2836
|
-
}
|
|
2837
|
-
this.valueBlock.value = String.fromCharCode.apply(null, new Uint32Array(copyBuffer));
|
|
2838
|
-
}
|
|
2839
|
-
fromString(inputString) {
|
|
2840
|
-
const strLength = inputString.length;
|
|
2841
|
-
const valueHexView = (this.valueBlock.valueHexView = new Uint8Array(strLength * 4));
|
|
2842
|
-
for (let i = 0; i < strLength; i++) {
|
|
2843
|
-
const codeBuf = pvutils__namespace.utilToBase(inputString.charCodeAt(i), 8);
|
|
2844
|
-
const codeView = new Uint8Array(codeBuf);
|
|
2845
|
-
if (codeView.length > 4)
|
|
2846
|
-
continue;
|
|
2847
|
-
const dif = 4 - codeView.length;
|
|
2848
|
-
for (let j = codeView.length - 1; j >= 0; j--)
|
|
2849
|
-
valueHexView[i * 4 + j + dif] = codeView[j];
|
|
2850
|
-
}
|
|
2851
|
-
this.valueBlock.value = inputString;
|
|
2852
|
-
}
|
|
2853
|
-
}
|
|
2854
|
-
LocalUniversalStringValueBlock.NAME = "UniversalStringValueBlock";
|
|
2855
|
-
|
|
2856
|
-
var _a$g;
|
|
2857
|
-
class UniversalString extends LocalUniversalStringValueBlock {
|
|
2858
|
-
constructor({ ...parameters } = {}) {
|
|
2859
|
-
super(parameters);
|
|
2860
|
-
this.idBlock.tagClass = 1;
|
|
2861
|
-
this.idBlock.tagNumber = 28;
|
|
2862
|
-
}
|
|
2863
|
-
}
|
|
2864
|
-
_a$g = UniversalString;
|
|
2865
|
-
(() => {
|
|
2866
|
-
typeStore.UniversalString = _a$g;
|
|
2867
|
-
})();
|
|
2868
|
-
UniversalString.NAME = "UniversalString";
|
|
2869
|
-
|
|
2870
|
-
var _a$f;
|
|
2871
|
-
class NumericString extends LocalSimpleStringBlock {
|
|
2872
|
-
constructor(parameters = {}) {
|
|
2873
|
-
super(parameters);
|
|
2874
|
-
this.idBlock.tagClass = 1;
|
|
2875
|
-
this.idBlock.tagNumber = 18;
|
|
2876
|
-
}
|
|
2877
|
-
}
|
|
2878
|
-
_a$f = NumericString;
|
|
2879
|
-
(() => {
|
|
2880
|
-
typeStore.NumericString = _a$f;
|
|
2881
|
-
})();
|
|
2882
|
-
NumericString.NAME = "NumericString";
|
|
2883
|
-
|
|
2884
|
-
var _a$e;
|
|
2885
|
-
class PrintableString extends LocalSimpleStringBlock {
|
|
2886
|
-
constructor(parameters = {}) {
|
|
2887
|
-
super(parameters);
|
|
2888
|
-
this.idBlock.tagClass = 1;
|
|
2889
|
-
this.idBlock.tagNumber = 19;
|
|
2890
|
-
}
|
|
2891
|
-
}
|
|
2892
|
-
_a$e = PrintableString;
|
|
2893
|
-
(() => {
|
|
2894
|
-
typeStore.PrintableString = _a$e;
|
|
2895
|
-
})();
|
|
2896
|
-
PrintableString.NAME = "PrintableString";
|
|
2897
|
-
|
|
2898
|
-
var _a$d;
|
|
2899
|
-
class TeletexString extends LocalSimpleStringBlock {
|
|
2900
|
-
constructor(parameters = {}) {
|
|
2901
|
-
super(parameters);
|
|
2902
|
-
this.idBlock.tagClass = 1;
|
|
2903
|
-
this.idBlock.tagNumber = 20;
|
|
2904
|
-
}
|
|
2905
|
-
}
|
|
2906
|
-
_a$d = TeletexString;
|
|
2907
|
-
(() => {
|
|
2908
|
-
typeStore.TeletexString = _a$d;
|
|
2909
|
-
})();
|
|
2910
|
-
TeletexString.NAME = "TeletexString";
|
|
2911
|
-
|
|
2912
|
-
var _a$c;
|
|
2913
|
-
class VideotexString extends LocalSimpleStringBlock {
|
|
2914
|
-
constructor(parameters = {}) {
|
|
2915
|
-
super(parameters);
|
|
2916
|
-
this.idBlock.tagClass = 1;
|
|
2917
|
-
this.idBlock.tagNumber = 21;
|
|
2918
|
-
}
|
|
2919
|
-
}
|
|
2920
|
-
_a$c = VideotexString;
|
|
2921
|
-
(() => {
|
|
2922
|
-
typeStore.VideotexString = _a$c;
|
|
2923
|
-
})();
|
|
2924
|
-
VideotexString.NAME = "VideotexString";
|
|
2925
|
-
|
|
2926
|
-
var _a$b;
|
|
2927
|
-
class IA5String extends LocalSimpleStringBlock {
|
|
2928
|
-
constructor(parameters = {}) {
|
|
2929
|
-
super(parameters);
|
|
2930
|
-
this.idBlock.tagClass = 1;
|
|
2931
|
-
this.idBlock.tagNumber = 22;
|
|
2932
|
-
}
|
|
2933
|
-
}
|
|
2934
|
-
_a$b = IA5String;
|
|
2935
|
-
(() => {
|
|
2936
|
-
typeStore.IA5String = _a$b;
|
|
2937
|
-
})();
|
|
2938
|
-
IA5String.NAME = "IA5String";
|
|
2939
|
-
|
|
2940
|
-
var _a$a;
|
|
2941
|
-
class GraphicString extends LocalSimpleStringBlock {
|
|
2942
|
-
constructor(parameters = {}) {
|
|
2943
|
-
super(parameters);
|
|
2944
|
-
this.idBlock.tagClass = 1;
|
|
2945
|
-
this.idBlock.tagNumber = 25;
|
|
2946
|
-
}
|
|
2947
|
-
}
|
|
2948
|
-
_a$a = GraphicString;
|
|
2949
|
-
(() => {
|
|
2950
|
-
typeStore.GraphicString = _a$a;
|
|
2951
|
-
})();
|
|
2952
|
-
GraphicString.NAME = "GraphicString";
|
|
2953
|
-
|
|
2954
|
-
var _a$9;
|
|
2955
|
-
class VisibleString extends LocalSimpleStringBlock {
|
|
2956
|
-
constructor(parameters = {}) {
|
|
2957
|
-
super(parameters);
|
|
2958
|
-
this.idBlock.tagClass = 1;
|
|
2959
|
-
this.idBlock.tagNumber = 26;
|
|
2960
|
-
}
|
|
2961
|
-
}
|
|
2962
|
-
_a$9 = VisibleString;
|
|
2963
|
-
(() => {
|
|
2964
|
-
typeStore.VisibleString = _a$9;
|
|
2965
|
-
})();
|
|
2966
|
-
VisibleString.NAME = "VisibleString";
|
|
2967
|
-
|
|
2968
|
-
var _a$8;
|
|
2969
|
-
class GeneralString extends LocalSimpleStringBlock {
|
|
2970
|
-
constructor(parameters = {}) {
|
|
2971
|
-
super(parameters);
|
|
2972
|
-
this.idBlock.tagClass = 1;
|
|
2973
|
-
this.idBlock.tagNumber = 27;
|
|
2974
|
-
}
|
|
2975
|
-
}
|
|
2976
|
-
_a$8 = GeneralString;
|
|
2977
|
-
(() => {
|
|
2978
|
-
typeStore.GeneralString = _a$8;
|
|
2979
|
-
})();
|
|
2980
|
-
GeneralString.NAME = "GeneralString";
|
|
2981
|
-
|
|
2982
|
-
var _a$7;
|
|
2983
|
-
class CharacterString extends LocalSimpleStringBlock {
|
|
2984
|
-
constructor(parameters = {}) {
|
|
2985
|
-
super(parameters);
|
|
2986
|
-
this.idBlock.tagClass = 1;
|
|
2987
|
-
this.idBlock.tagNumber = 29;
|
|
2988
|
-
}
|
|
2989
|
-
}
|
|
2990
|
-
_a$7 = CharacterString;
|
|
2991
|
-
(() => {
|
|
2992
|
-
typeStore.CharacterString = _a$7;
|
|
2993
|
-
})();
|
|
2994
|
-
CharacterString.NAME = "CharacterString";
|
|
2995
|
-
|
|
2996
|
-
var _a$6;
|
|
2997
|
-
class UTCTime extends VisibleString {
|
|
2998
|
-
constructor({ value, valueDate, ...parameters } = {}) {
|
|
2999
|
-
super(parameters);
|
|
3000
|
-
this.year = 0;
|
|
3001
|
-
this.month = 0;
|
|
3002
|
-
this.day = 0;
|
|
3003
|
-
this.hour = 0;
|
|
3004
|
-
this.minute = 0;
|
|
3005
|
-
this.second = 0;
|
|
3006
|
-
if (value) {
|
|
3007
|
-
this.fromString(value);
|
|
3008
|
-
this.valueBlock.valueHexView = new Uint8Array(value.length);
|
|
3009
|
-
for (let i = 0; i < value.length; i++)
|
|
3010
|
-
this.valueBlock.valueHexView[i] = value.charCodeAt(i);
|
|
3011
|
-
}
|
|
3012
|
-
if (valueDate) {
|
|
3013
|
-
this.fromDate(valueDate);
|
|
3014
|
-
this.valueBlock.valueHexView = new Uint8Array(this.toBuffer());
|
|
3015
|
-
}
|
|
3016
|
-
this.idBlock.tagClass = 1;
|
|
3017
|
-
this.idBlock.tagNumber = 23;
|
|
3018
|
-
}
|
|
3019
|
-
fromBuffer(inputBuffer) {
|
|
3020
|
-
this.fromString(String.fromCharCode.apply(null, pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer)));
|
|
3021
|
-
}
|
|
3022
|
-
toBuffer() {
|
|
3023
|
-
const str = this.toString();
|
|
3024
|
-
const buffer = new ArrayBuffer(str.length);
|
|
3025
|
-
const view = new Uint8Array(buffer);
|
|
3026
|
-
for (let i = 0; i < str.length; i++)
|
|
3027
|
-
view[i] = str.charCodeAt(i);
|
|
3028
|
-
return buffer;
|
|
3029
|
-
}
|
|
3030
|
-
fromDate(inputDate) {
|
|
3031
|
-
this.year = inputDate.getUTCFullYear();
|
|
3032
|
-
this.month = inputDate.getUTCMonth() + 1;
|
|
3033
|
-
this.day = inputDate.getUTCDate();
|
|
3034
|
-
this.hour = inputDate.getUTCHours();
|
|
3035
|
-
this.minute = inputDate.getUTCMinutes();
|
|
3036
|
-
this.second = inputDate.getUTCSeconds();
|
|
3037
|
-
}
|
|
3038
|
-
toDate() {
|
|
3039
|
-
return new Date(Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second));
|
|
3040
|
-
}
|
|
3041
|
-
fromString(inputString) {
|
|
3042
|
-
const parser = /(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/gi;
|
|
3043
|
-
const parserArray = parser.exec(inputString);
|
|
3044
|
-
if (parserArray === null) {
|
|
3045
|
-
this.error = "Wrong input string for conversion";
|
|
3046
|
-
return;
|
|
3047
|
-
}
|
|
3048
|
-
const year = parseInt(parserArray[1], 10);
|
|
3049
|
-
if (year >= 50)
|
|
3050
|
-
this.year = 1900 + year;
|
|
3051
|
-
else
|
|
3052
|
-
this.year = 2000 + year;
|
|
3053
|
-
this.month = parseInt(parserArray[2], 10);
|
|
3054
|
-
this.day = parseInt(parserArray[3], 10);
|
|
3055
|
-
this.hour = parseInt(parserArray[4], 10);
|
|
3056
|
-
this.minute = parseInt(parserArray[5], 10);
|
|
3057
|
-
this.second = parseInt(parserArray[6], 10);
|
|
3058
|
-
}
|
|
3059
|
-
toString(encoding = "iso") {
|
|
3060
|
-
if (encoding === "iso") {
|
|
3061
|
-
const outputArray = Array.from({ length: 7 });
|
|
3062
|
-
outputArray[0] = pvutils__namespace.padNumber(this.year < 2000 ? this.year - 1900 : this.year - 2000, 2);
|
|
3063
|
-
outputArray[1] = pvutils__namespace.padNumber(this.month, 2);
|
|
3064
|
-
outputArray[2] = pvutils__namespace.padNumber(this.day, 2);
|
|
3065
|
-
outputArray[3] = pvutils__namespace.padNumber(this.hour, 2);
|
|
3066
|
-
outputArray[4] = pvutils__namespace.padNumber(this.minute, 2);
|
|
3067
|
-
outputArray[5] = pvutils__namespace.padNumber(this.second, 2);
|
|
3068
|
-
outputArray[6] = "Z";
|
|
3069
|
-
return outputArray.join("");
|
|
3070
|
-
}
|
|
3071
|
-
return super.toString(encoding);
|
|
3072
|
-
}
|
|
3073
|
-
onAsciiEncoding() {
|
|
3074
|
-
return `${this.constructor.NAME} : ${this.toDate().toISOString()}`;
|
|
3075
|
-
}
|
|
3076
|
-
toJSON() {
|
|
3077
|
-
return {
|
|
3078
|
-
...super.toJSON(),
|
|
3079
|
-
year: this.year,
|
|
3080
|
-
month: this.month,
|
|
3081
|
-
day: this.day,
|
|
3082
|
-
hour: this.hour,
|
|
3083
|
-
minute: this.minute,
|
|
3084
|
-
second: this.second
|
|
3085
|
-
};
|
|
3086
|
-
}
|
|
3087
|
-
}
|
|
3088
|
-
_a$6 = UTCTime;
|
|
3089
|
-
(() => {
|
|
3090
|
-
typeStore.UTCTime = _a$6;
|
|
3091
|
-
})();
|
|
3092
|
-
UTCTime.NAME = "UTCTime";
|
|
3093
|
-
|
|
3094
|
-
var _a$5;
|
|
3095
|
-
class GeneralizedTime extends UTCTime {
|
|
3096
|
-
constructor(parameters = {}) {
|
|
3097
|
-
var _b;
|
|
3098
|
-
super(parameters);
|
|
3099
|
-
(_b = this.millisecond) !== null && _b !== void 0 ? _b : (this.millisecond = 0);
|
|
3100
|
-
this.idBlock.tagClass = 1;
|
|
3101
|
-
this.idBlock.tagNumber = 24;
|
|
3102
|
-
}
|
|
3103
|
-
fromDate(inputDate) {
|
|
3104
|
-
super.fromDate(inputDate);
|
|
3105
|
-
this.millisecond = inputDate.getUTCMilliseconds();
|
|
3106
|
-
}
|
|
3107
|
-
toDate() {
|
|
3108
|
-
const utcDate = Date.UTC(this.year, this.month - 1, this.day, this.hour, this.minute, this.second, this.millisecond);
|
|
3109
|
-
return new Date(utcDate);
|
|
3110
|
-
}
|
|
3111
|
-
fromString(inputString) {
|
|
3112
|
-
let isUTC = false;
|
|
3113
|
-
let timeString = "";
|
|
3114
|
-
let dateTimeString = "";
|
|
3115
|
-
let fractionPart = 0;
|
|
3116
|
-
let parser;
|
|
3117
|
-
let hourDifference = 0;
|
|
3118
|
-
let minuteDifference = 0;
|
|
3119
|
-
if (inputString[inputString.length - 1] === "Z") {
|
|
3120
|
-
timeString = inputString.substring(0, inputString.length - 1);
|
|
3121
|
-
isUTC = true;
|
|
3122
|
-
}
|
|
3123
|
-
else {
|
|
3124
|
-
const number = new Number(inputString[inputString.length - 1]);
|
|
3125
|
-
if (isNaN(number.valueOf()))
|
|
3126
|
-
throw new Error("Wrong input string for conversion");
|
|
3127
|
-
timeString = inputString;
|
|
3128
|
-
}
|
|
3129
|
-
if (isUTC) {
|
|
3130
|
-
if (timeString.indexOf("+") !== -1)
|
|
3131
|
-
throw new Error("Wrong input string for conversion");
|
|
3132
|
-
if (timeString.indexOf("-") !== -1)
|
|
3133
|
-
throw new Error("Wrong input string for conversion");
|
|
3134
|
-
}
|
|
3135
|
-
else {
|
|
3136
|
-
let multiplier = 1;
|
|
3137
|
-
let differencePosition = timeString.indexOf("+");
|
|
3138
|
-
let differenceString = "";
|
|
3139
|
-
if (differencePosition === -1) {
|
|
3140
|
-
differencePosition = timeString.indexOf("-");
|
|
3141
|
-
multiplier = -1;
|
|
3142
|
-
}
|
|
3143
|
-
if (differencePosition !== -1) {
|
|
3144
|
-
differenceString = timeString.substring(differencePosition + 1);
|
|
3145
|
-
timeString = timeString.substring(0, differencePosition);
|
|
3146
|
-
if (differenceString.length !== 2 && differenceString.length !== 4)
|
|
3147
|
-
throw new Error("Wrong input string for conversion");
|
|
3148
|
-
let number = parseInt(differenceString.substring(0, 2), 10);
|
|
3149
|
-
if (isNaN(number.valueOf()))
|
|
3150
|
-
throw new Error("Wrong input string for conversion");
|
|
3151
|
-
hourDifference = multiplier * number;
|
|
3152
|
-
if (differenceString.length === 4) {
|
|
3153
|
-
number = parseInt(differenceString.substring(2, 4), 10);
|
|
3154
|
-
if (isNaN(number.valueOf()))
|
|
3155
|
-
throw new Error("Wrong input string for conversion");
|
|
3156
|
-
minuteDifference = multiplier * number;
|
|
3157
|
-
}
|
|
3158
|
-
}
|
|
3159
|
-
}
|
|
3160
|
-
let fractionPointPosition = timeString.indexOf(".");
|
|
3161
|
-
if (fractionPointPosition === -1)
|
|
3162
|
-
fractionPointPosition = timeString.indexOf(",");
|
|
3163
|
-
if (fractionPointPosition !== -1) {
|
|
3164
|
-
const fractionPartCheck = new Number(`0${timeString.substring(fractionPointPosition)}`);
|
|
3165
|
-
if (isNaN(fractionPartCheck.valueOf()))
|
|
3166
|
-
throw new Error("Wrong input string for conversion");
|
|
3167
|
-
fractionPart = fractionPartCheck.valueOf();
|
|
3168
|
-
dateTimeString = timeString.substring(0, fractionPointPosition);
|
|
3169
|
-
}
|
|
3170
|
-
else
|
|
3171
|
-
dateTimeString = timeString;
|
|
3172
|
-
switch (true) {
|
|
3173
|
-
case dateTimeString.length === 8:
|
|
3174
|
-
parser = /(\d{4})(\d{2})(\d{2})/gi;
|
|
3175
|
-
if (fractionPointPosition !== -1)
|
|
3176
|
-
throw new Error("Wrong input string for conversion");
|
|
3177
|
-
break;
|
|
3178
|
-
case dateTimeString.length === 10:
|
|
3179
|
-
parser = /(\d{4})(\d{2})(\d{2})(\d{2})/gi;
|
|
3180
|
-
if (fractionPointPosition !== -1) {
|
|
3181
|
-
let fractionResult = 60 * fractionPart;
|
|
3182
|
-
this.minute = Math.floor(fractionResult);
|
|
3183
|
-
fractionResult = 60 * (fractionResult - this.minute);
|
|
3184
|
-
this.second = Math.floor(fractionResult);
|
|
3185
|
-
fractionResult = 1000 * (fractionResult - this.second);
|
|
3186
|
-
this.millisecond = Math.floor(fractionResult);
|
|
3187
|
-
}
|
|
3188
|
-
break;
|
|
3189
|
-
case dateTimeString.length === 12:
|
|
3190
|
-
parser = /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/gi;
|
|
3191
|
-
if (fractionPointPosition !== -1) {
|
|
3192
|
-
let fractionResult = 60 * fractionPart;
|
|
3193
|
-
this.second = Math.floor(fractionResult);
|
|
3194
|
-
fractionResult = 1000 * (fractionResult - this.second);
|
|
3195
|
-
this.millisecond = Math.floor(fractionResult);
|
|
3196
|
-
}
|
|
3197
|
-
break;
|
|
3198
|
-
case dateTimeString.length === 14:
|
|
3199
|
-
parser = /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/gi;
|
|
3200
|
-
if (fractionPointPosition !== -1) {
|
|
3201
|
-
const fractionResult = 1000 * fractionPart;
|
|
3202
|
-
this.millisecond = Math.floor(fractionResult);
|
|
3203
|
-
}
|
|
3204
|
-
break;
|
|
3205
|
-
default:
|
|
3206
|
-
throw new Error("Wrong input string for conversion");
|
|
3207
|
-
}
|
|
3208
|
-
const parserArray = parser.exec(dateTimeString);
|
|
3209
|
-
if (parserArray === null)
|
|
3210
|
-
throw new Error("Wrong input string for conversion");
|
|
3211
|
-
for (let j = 1; j < parserArray.length; j++) {
|
|
3212
|
-
switch (j) {
|
|
3213
|
-
case 1:
|
|
3214
|
-
this.year = parseInt(parserArray[j], 10);
|
|
3215
|
-
break;
|
|
3216
|
-
case 2:
|
|
3217
|
-
this.month = parseInt(parserArray[j], 10);
|
|
3218
|
-
break;
|
|
3219
|
-
case 3:
|
|
3220
|
-
this.day = parseInt(parserArray[j], 10);
|
|
3221
|
-
break;
|
|
3222
|
-
case 4:
|
|
3223
|
-
this.hour = parseInt(parserArray[j], 10) + hourDifference;
|
|
3224
|
-
break;
|
|
3225
|
-
case 5:
|
|
3226
|
-
this.minute = parseInt(parserArray[j], 10) + minuteDifference;
|
|
3227
|
-
break;
|
|
3228
|
-
case 6:
|
|
3229
|
-
this.second = parseInt(parserArray[j], 10);
|
|
3230
|
-
break;
|
|
3231
|
-
default:
|
|
3232
|
-
throw new Error("Wrong input string for conversion");
|
|
3233
|
-
}
|
|
3234
|
-
}
|
|
3235
|
-
if (isUTC === false) {
|
|
3236
|
-
const tempDate = new Date(this.year, this.month, this.day, this.hour, this.minute, this.second, this.millisecond);
|
|
3237
|
-
this.year = tempDate.getUTCFullYear();
|
|
3238
|
-
this.month = tempDate.getUTCMonth();
|
|
3239
|
-
this.day = tempDate.getUTCDay();
|
|
3240
|
-
this.hour = tempDate.getUTCHours();
|
|
3241
|
-
this.minute = tempDate.getUTCMinutes();
|
|
3242
|
-
this.second = tempDate.getUTCSeconds();
|
|
3243
|
-
this.millisecond = tempDate.getUTCMilliseconds();
|
|
3244
|
-
}
|
|
3245
|
-
}
|
|
3246
|
-
toString(encoding = "iso") {
|
|
3247
|
-
if (encoding === "iso") {
|
|
3248
|
-
const outputArray = [];
|
|
3249
|
-
outputArray.push(pvutils__namespace.padNumber(this.year, 4));
|
|
3250
|
-
outputArray.push(pvutils__namespace.padNumber(this.month, 2));
|
|
3251
|
-
outputArray.push(pvutils__namespace.padNumber(this.day, 2));
|
|
3252
|
-
outputArray.push(pvutils__namespace.padNumber(this.hour, 2));
|
|
3253
|
-
outputArray.push(pvutils__namespace.padNumber(this.minute, 2));
|
|
3254
|
-
outputArray.push(pvutils__namespace.padNumber(this.second, 2));
|
|
3255
|
-
if (this.millisecond !== 0) {
|
|
3256
|
-
outputArray.push(".");
|
|
3257
|
-
outputArray.push(pvutils__namespace.padNumber(this.millisecond, 3).replace(/0+$/, ""));
|
|
3258
|
-
}
|
|
3259
|
-
outputArray.push("Z");
|
|
3260
|
-
return outputArray.join("");
|
|
3261
|
-
}
|
|
3262
|
-
return super.toString(encoding);
|
|
3263
|
-
}
|
|
3264
|
-
toJSON() {
|
|
3265
|
-
return {
|
|
3266
|
-
...super.toJSON(),
|
|
3267
|
-
millisecond: this.millisecond
|
|
3268
|
-
};
|
|
3269
|
-
}
|
|
3270
|
-
}
|
|
3271
|
-
_a$5 = GeneralizedTime;
|
|
3272
|
-
(() => {
|
|
3273
|
-
typeStore.GeneralizedTime = _a$5;
|
|
3274
|
-
})();
|
|
3275
|
-
GeneralizedTime.NAME = "GeneralizedTime";
|
|
3276
|
-
|
|
3277
|
-
var _a$4;
|
|
3278
|
-
class DATE extends Utf8String {
|
|
3279
|
-
constructor(parameters = {}) {
|
|
3280
|
-
super(parameters);
|
|
3281
|
-
this.idBlock.tagClass = 1;
|
|
3282
|
-
this.idBlock.tagNumber = 31;
|
|
3283
|
-
}
|
|
3284
|
-
}
|
|
3285
|
-
_a$4 = DATE;
|
|
3286
|
-
(() => {
|
|
3287
|
-
typeStore.DATE = _a$4;
|
|
3288
|
-
})();
|
|
3289
|
-
DATE.NAME = "DATE";
|
|
3290
|
-
|
|
3291
|
-
var _a$3;
|
|
3292
|
-
class TimeOfDay extends Utf8String {
|
|
3293
|
-
constructor(parameters = {}) {
|
|
3294
|
-
super(parameters);
|
|
3295
|
-
this.idBlock.tagClass = 1;
|
|
3296
|
-
this.idBlock.tagNumber = 32;
|
|
3297
|
-
}
|
|
3298
|
-
}
|
|
3299
|
-
_a$3 = TimeOfDay;
|
|
3300
|
-
(() => {
|
|
3301
|
-
typeStore.TimeOfDay = _a$3;
|
|
3302
|
-
})();
|
|
3303
|
-
TimeOfDay.NAME = "TimeOfDay";
|
|
3304
|
-
|
|
3305
|
-
var _a$2;
|
|
3306
|
-
class DateTime extends Utf8String {
|
|
3307
|
-
constructor(parameters = {}) {
|
|
3308
|
-
super(parameters);
|
|
3309
|
-
this.idBlock.tagClass = 1;
|
|
3310
|
-
this.idBlock.tagNumber = 33;
|
|
3311
|
-
}
|
|
3312
|
-
}
|
|
3313
|
-
_a$2 = DateTime;
|
|
3314
|
-
(() => {
|
|
3315
|
-
typeStore.DateTime = _a$2;
|
|
3316
|
-
})();
|
|
3317
|
-
DateTime.NAME = "DateTime";
|
|
3318
|
-
|
|
3319
|
-
var _a$1;
|
|
3320
|
-
class Duration extends Utf8String {
|
|
3321
|
-
constructor(parameters = {}) {
|
|
3322
|
-
super(parameters);
|
|
3323
|
-
this.idBlock.tagClass = 1;
|
|
3324
|
-
this.idBlock.tagNumber = 34;
|
|
3325
|
-
}
|
|
3326
|
-
}
|
|
3327
|
-
_a$1 = Duration;
|
|
3328
|
-
(() => {
|
|
3329
|
-
typeStore.Duration = _a$1;
|
|
3330
|
-
})();
|
|
3331
|
-
Duration.NAME = "Duration";
|
|
3332
|
-
|
|
3333
|
-
var _a;
|
|
3334
|
-
class TIME extends Utf8String {
|
|
3335
|
-
constructor(parameters = {}) {
|
|
3336
|
-
super(parameters);
|
|
3337
|
-
this.idBlock.tagClass = 1;
|
|
3338
|
-
this.idBlock.tagNumber = 14;
|
|
3339
|
-
}
|
|
3340
|
-
}
|
|
3341
|
-
_a = TIME;
|
|
3342
|
-
(() => {
|
|
3343
|
-
typeStore.TIME = _a;
|
|
3344
|
-
})();
|
|
3345
|
-
TIME.NAME = "TIME";
|
|
3346
|
-
|
|
3347
|
-
class Any {
|
|
3348
|
-
constructor({ name = EMPTY_STRING, optional = false } = {}) {
|
|
3349
|
-
this.name = name;
|
|
3350
|
-
this.optional = optional;
|
|
3351
|
-
}
|
|
3352
|
-
}
|
|
3353
|
-
|
|
3354
|
-
class Choice extends Any {
|
|
3355
|
-
constructor({ value = [], ...parameters } = {}) {
|
|
3356
|
-
super(parameters);
|
|
3357
|
-
this.value = value;
|
|
3358
|
-
}
|
|
3359
|
-
}
|
|
3360
|
-
|
|
3361
|
-
class Repeated extends Any {
|
|
3362
|
-
constructor({ value = new Any(), local = false, ...parameters } = {}) {
|
|
3363
|
-
super(parameters);
|
|
3364
|
-
this.value = value;
|
|
3365
|
-
this.local = local;
|
|
3366
|
-
}
|
|
3367
|
-
}
|
|
3368
|
-
|
|
3369
|
-
class RawData {
|
|
3370
|
-
get data() {
|
|
3371
|
-
return this.dataView.slice().buffer;
|
|
3372
|
-
}
|
|
3373
|
-
set data(value) {
|
|
3374
|
-
this.dataView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(value);
|
|
3375
|
-
}
|
|
3376
|
-
constructor({ data = EMPTY_VIEW } = {}) {
|
|
3377
|
-
this.dataView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(data);
|
|
3378
|
-
}
|
|
3379
|
-
fromBER(inputBuffer, inputOffset, inputLength) {
|
|
3380
|
-
const endLength = inputOffset + inputLength;
|
|
3381
|
-
this.dataView = pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer).subarray(inputOffset, endLength);
|
|
3382
|
-
return endLength;
|
|
3383
|
-
}
|
|
3384
|
-
toBER(_sizeOnly) {
|
|
3385
|
-
return this.dataView.slice().buffer;
|
|
3386
|
-
}
|
|
3387
|
-
}
|
|
3388
|
-
|
|
3389
|
-
function compareSchema(root, inputData, inputSchema) {
|
|
3390
|
-
if (inputSchema instanceof Choice) {
|
|
3391
|
-
for (const element of inputSchema.value) {
|
|
3392
|
-
const result = compareSchema(root, inputData, element);
|
|
3393
|
-
if (result.verified) {
|
|
3394
|
-
return {
|
|
3395
|
-
verified: true,
|
|
3396
|
-
result: root
|
|
3397
|
-
};
|
|
3398
|
-
}
|
|
3399
|
-
}
|
|
3400
|
-
{
|
|
3401
|
-
const _result = {
|
|
3402
|
-
verified: false,
|
|
3403
|
-
result: { error: "Wrong values for Choice type" }
|
|
3404
|
-
};
|
|
3405
|
-
if (inputSchema.hasOwnProperty(NAME))
|
|
3406
|
-
_result.name = inputSchema.name;
|
|
3407
|
-
return _result;
|
|
3408
|
-
}
|
|
3409
|
-
}
|
|
3410
|
-
if (inputSchema instanceof Any) {
|
|
3411
|
-
if (inputSchema.hasOwnProperty(NAME))
|
|
3412
|
-
root[inputSchema.name] = inputData;
|
|
3413
|
-
return {
|
|
3414
|
-
verified: true,
|
|
3415
|
-
result: root
|
|
3416
|
-
};
|
|
3417
|
-
}
|
|
3418
|
-
if (root instanceof Object === false) {
|
|
3419
|
-
return {
|
|
3420
|
-
verified: false,
|
|
3421
|
-
result: { error: "Wrong root object" }
|
|
3422
|
-
};
|
|
3423
|
-
}
|
|
3424
|
-
if (inputData instanceof Object === false) {
|
|
3425
|
-
return {
|
|
3426
|
-
verified: false,
|
|
3427
|
-
result: { error: "Wrong ASN.1 data" }
|
|
3428
|
-
};
|
|
3429
|
-
}
|
|
3430
|
-
if (inputSchema instanceof Object === false) {
|
|
3431
|
-
return {
|
|
3432
|
-
verified: false,
|
|
3433
|
-
result: { error: "Wrong ASN.1 schema" }
|
|
3434
|
-
};
|
|
3435
|
-
}
|
|
3436
|
-
if (ID_BLOCK in inputSchema === false) {
|
|
3437
|
-
return {
|
|
3438
|
-
verified: false,
|
|
3439
|
-
result: { error: "Wrong ASN.1 schema" }
|
|
3440
|
-
};
|
|
3441
|
-
}
|
|
3442
|
-
if (FROM_BER in inputSchema.idBlock === false) {
|
|
3443
|
-
return {
|
|
3444
|
-
verified: false,
|
|
3445
|
-
result: { error: "Wrong ASN.1 schema" }
|
|
3446
|
-
};
|
|
3447
|
-
}
|
|
3448
|
-
if (TO_BER in inputSchema.idBlock === false) {
|
|
3449
|
-
return {
|
|
3450
|
-
verified: false,
|
|
3451
|
-
result: { error: "Wrong ASN.1 schema" }
|
|
3452
|
-
};
|
|
3453
|
-
}
|
|
3454
|
-
const encodedId = inputSchema.idBlock.toBER(false);
|
|
3455
|
-
if (encodedId.byteLength === 0) {
|
|
3456
|
-
return {
|
|
3457
|
-
verified: false,
|
|
3458
|
-
result: { error: "Error encoding idBlock for ASN.1 schema" }
|
|
3459
|
-
};
|
|
3460
|
-
}
|
|
3461
|
-
const decodedOffset = inputSchema.idBlock.fromBER(encodedId, 0, encodedId.byteLength);
|
|
3462
|
-
if (decodedOffset === -1) {
|
|
3463
|
-
return {
|
|
3464
|
-
verified: false,
|
|
3465
|
-
result: { error: "Error decoding idBlock for ASN.1 schema" }
|
|
3466
|
-
};
|
|
3467
|
-
}
|
|
3468
|
-
if (inputSchema.idBlock.hasOwnProperty(TAG_CLASS) === false) {
|
|
3469
|
-
return {
|
|
3470
|
-
verified: false,
|
|
3471
|
-
result: { error: "Wrong ASN.1 schema" }
|
|
3472
|
-
};
|
|
3473
|
-
}
|
|
3474
|
-
if (inputSchema.idBlock.tagClass !== inputData.idBlock.tagClass) {
|
|
3475
|
-
return {
|
|
3476
|
-
verified: false,
|
|
3477
|
-
result: root
|
|
3478
|
-
};
|
|
3479
|
-
}
|
|
3480
|
-
if (inputSchema.idBlock.hasOwnProperty(TAG_NUMBER) === false) {
|
|
3481
|
-
return {
|
|
3482
|
-
verified: false,
|
|
3483
|
-
result: { error: "Wrong ASN.1 schema" }
|
|
3484
|
-
};
|
|
3485
|
-
}
|
|
3486
|
-
if (inputSchema.idBlock.tagNumber !== inputData.idBlock.tagNumber) {
|
|
3487
|
-
return {
|
|
3488
|
-
verified: false,
|
|
3489
|
-
result: root
|
|
3490
|
-
};
|
|
3491
|
-
}
|
|
3492
|
-
if (inputSchema.idBlock.hasOwnProperty(IS_CONSTRUCTED) === false) {
|
|
3493
|
-
return {
|
|
3494
|
-
verified: false,
|
|
3495
|
-
result: { error: "Wrong ASN.1 schema" }
|
|
3496
|
-
};
|
|
3497
|
-
}
|
|
3498
|
-
if (inputSchema.idBlock.isConstructed !== inputData.idBlock.isConstructed) {
|
|
3499
|
-
return {
|
|
3500
|
-
verified: false,
|
|
3501
|
-
result: root
|
|
3502
|
-
};
|
|
3503
|
-
}
|
|
3504
|
-
if (!(IS_HEX_ONLY in inputSchema.idBlock)) {
|
|
3505
|
-
return {
|
|
3506
|
-
verified: false,
|
|
3507
|
-
result: { error: "Wrong ASN.1 schema" }
|
|
3508
|
-
};
|
|
3509
|
-
}
|
|
3510
|
-
if (inputSchema.idBlock.isHexOnly !== inputData.idBlock.isHexOnly) {
|
|
3511
|
-
return {
|
|
3512
|
-
verified: false,
|
|
3513
|
-
result: root
|
|
3514
|
-
};
|
|
3515
|
-
}
|
|
3516
|
-
if (inputSchema.idBlock.isHexOnly) {
|
|
3517
|
-
if (VALUE_HEX_VIEW in inputSchema.idBlock === false) {
|
|
3518
|
-
return {
|
|
3519
|
-
verified: false,
|
|
3520
|
-
result: { error: "Wrong ASN.1 schema" }
|
|
3521
|
-
};
|
|
3522
|
-
}
|
|
3523
|
-
const schemaView = inputSchema.idBlock.valueHexView;
|
|
3524
|
-
const asn1View = inputData.idBlock.valueHexView;
|
|
3525
|
-
if (schemaView.length !== asn1View.length) {
|
|
3526
|
-
return {
|
|
3527
|
-
verified: false,
|
|
3528
|
-
result: root
|
|
3529
|
-
};
|
|
3530
|
-
}
|
|
3531
|
-
for (let i = 0; i < schemaView.length; i++) {
|
|
3532
|
-
if (schemaView[i] !== asn1View[1]) {
|
|
3533
|
-
return {
|
|
3534
|
-
verified: false,
|
|
3535
|
-
result: root
|
|
3536
|
-
};
|
|
3537
|
-
}
|
|
3538
|
-
}
|
|
3539
|
-
}
|
|
3540
|
-
if (inputSchema.name) {
|
|
3541
|
-
inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING);
|
|
3542
|
-
if (inputSchema.name)
|
|
3543
|
-
root[inputSchema.name] = inputData;
|
|
3544
|
-
}
|
|
3545
|
-
if (inputSchema instanceof typeStore.Constructed) {
|
|
3546
|
-
let admission = 0;
|
|
3547
|
-
let result = {
|
|
3548
|
-
verified: false,
|
|
3549
|
-
result: { error: "Unknown error" }
|
|
3550
|
-
};
|
|
3551
|
-
let maxLength = inputSchema.valueBlock.value.length;
|
|
3552
|
-
if (maxLength > 0) {
|
|
3553
|
-
if (inputSchema.valueBlock.value[0] instanceof Repeated) {
|
|
3554
|
-
maxLength = inputData.valueBlock.value.length;
|
|
3555
|
-
}
|
|
3556
|
-
}
|
|
3557
|
-
if (maxLength === 0) {
|
|
3558
|
-
return {
|
|
3559
|
-
verified: true,
|
|
3560
|
-
result: root
|
|
3561
|
-
};
|
|
3562
|
-
}
|
|
3563
|
-
if (inputData.valueBlock.value.length === 0 && inputSchema.valueBlock.value.length !== 0) {
|
|
3564
|
-
let _optional = true;
|
|
3565
|
-
for (let i = 0; i < inputSchema.valueBlock.value.length; i++)
|
|
3566
|
-
_optional = _optional && (inputSchema.valueBlock.value[i].optional || false);
|
|
3567
|
-
if (_optional) {
|
|
3568
|
-
return {
|
|
3569
|
-
verified: true,
|
|
3570
|
-
result: root
|
|
3571
|
-
};
|
|
3572
|
-
}
|
|
3573
|
-
if (inputSchema.name) {
|
|
3574
|
-
inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING);
|
|
3575
|
-
if (inputSchema.name)
|
|
3576
|
-
delete root[inputSchema.name];
|
|
3577
|
-
}
|
|
3578
|
-
root.error = "Inconsistent object length";
|
|
3579
|
-
return {
|
|
3580
|
-
verified: false,
|
|
3581
|
-
result: root
|
|
3582
|
-
};
|
|
3583
|
-
}
|
|
3584
|
-
for (let i = 0; i < maxLength; i++) {
|
|
3585
|
-
if (i - admission >= inputData.valueBlock.value.length) {
|
|
3586
|
-
if (inputSchema.valueBlock.value[i].optional === false) {
|
|
3587
|
-
const _result = {
|
|
3588
|
-
verified: false,
|
|
3589
|
-
result: root
|
|
3590
|
-
};
|
|
3591
|
-
root.error = "Inconsistent length between ASN.1 data and schema";
|
|
3592
|
-
if (inputSchema.name) {
|
|
3593
|
-
inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING);
|
|
3594
|
-
if (inputSchema.name) {
|
|
3595
|
-
delete root[inputSchema.name];
|
|
3596
|
-
_result.name = inputSchema.name;
|
|
3597
|
-
}
|
|
3598
|
-
}
|
|
3599
|
-
return _result;
|
|
3600
|
-
}
|
|
3601
|
-
}
|
|
3602
|
-
else {
|
|
3603
|
-
if (inputSchema.valueBlock.value[0] instanceof Repeated) {
|
|
3604
|
-
result = compareSchema(root, inputData.valueBlock.value[i], inputSchema.valueBlock.value[0].value);
|
|
3605
|
-
if (result.verified === false) {
|
|
3606
|
-
if (inputSchema.valueBlock.value[0].optional)
|
|
3607
|
-
admission++;
|
|
3608
|
-
else {
|
|
3609
|
-
if (inputSchema.name) {
|
|
3610
|
-
inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING);
|
|
3611
|
-
if (inputSchema.name)
|
|
3612
|
-
delete root[inputSchema.name];
|
|
3613
|
-
}
|
|
3614
|
-
return result;
|
|
3615
|
-
}
|
|
3616
|
-
}
|
|
3617
|
-
if (NAME in inputSchema.valueBlock.value[0] && inputSchema.valueBlock.value[0].name.length > 0) {
|
|
3618
|
-
let arrayRoot = {};
|
|
3619
|
-
if (LOCAL in inputSchema.valueBlock.value[0] && inputSchema.valueBlock.value[0].local)
|
|
3620
|
-
arrayRoot = inputData;
|
|
3621
|
-
else
|
|
3622
|
-
arrayRoot = root;
|
|
3623
|
-
if (typeof arrayRoot[inputSchema.valueBlock.value[0].name] === "undefined")
|
|
3624
|
-
arrayRoot[inputSchema.valueBlock.value[0].name] = [];
|
|
3625
|
-
arrayRoot[inputSchema.valueBlock.value[0].name].push(inputData.valueBlock.value[i]);
|
|
3626
|
-
}
|
|
3627
|
-
}
|
|
3628
|
-
else {
|
|
3629
|
-
result = compareSchema(root, inputData.valueBlock.value[i - admission], inputSchema.valueBlock.value[i]);
|
|
3630
|
-
if (result.verified === false) {
|
|
3631
|
-
if (inputSchema.valueBlock.value[i].optional)
|
|
3632
|
-
admission++;
|
|
3633
|
-
else {
|
|
3634
|
-
if (inputSchema.name) {
|
|
3635
|
-
inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING);
|
|
3636
|
-
if (inputSchema.name)
|
|
3637
|
-
delete root[inputSchema.name];
|
|
3638
|
-
}
|
|
3639
|
-
return result;
|
|
3640
|
-
}
|
|
3641
|
-
}
|
|
3642
|
-
}
|
|
3643
|
-
}
|
|
3644
|
-
}
|
|
3645
|
-
if (result.verified === false) {
|
|
3646
|
-
const _result = {
|
|
3647
|
-
verified: false,
|
|
3648
|
-
result: root
|
|
3649
|
-
};
|
|
3650
|
-
if (inputSchema.name) {
|
|
3651
|
-
inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING);
|
|
3652
|
-
if (inputSchema.name) {
|
|
3653
|
-
delete root[inputSchema.name];
|
|
3654
|
-
_result.name = inputSchema.name;
|
|
3655
|
-
}
|
|
3656
|
-
}
|
|
3657
|
-
return _result;
|
|
3658
|
-
}
|
|
3659
|
-
return {
|
|
3660
|
-
verified: true,
|
|
3661
|
-
result: root
|
|
3662
|
-
};
|
|
3663
|
-
}
|
|
3664
|
-
if (inputSchema.primitiveSchema && VALUE_HEX_VIEW in inputData.valueBlock) {
|
|
3665
|
-
const asn1 = localFromBER(inputData.valueBlock.valueHexView);
|
|
3666
|
-
if (asn1.offset === -1) {
|
|
3667
|
-
const _result = {
|
|
3668
|
-
verified: false,
|
|
3669
|
-
result: asn1.result
|
|
3670
|
-
};
|
|
3671
|
-
if (inputSchema.name) {
|
|
3672
|
-
inputSchema.name = inputSchema.name.replace(/^\s+|\s+$/g, EMPTY_STRING);
|
|
3673
|
-
if (inputSchema.name) {
|
|
3674
|
-
delete root[inputSchema.name];
|
|
3675
|
-
_result.name = inputSchema.name;
|
|
3676
|
-
}
|
|
3677
|
-
}
|
|
3678
|
-
return _result;
|
|
3679
|
-
}
|
|
3680
|
-
return compareSchema(root, asn1.result, inputSchema.primitiveSchema);
|
|
3681
|
-
}
|
|
3682
|
-
return {
|
|
3683
|
-
verified: true,
|
|
3684
|
-
result: root
|
|
3685
|
-
};
|
|
3686
|
-
}
|
|
3687
|
-
function verifySchema(inputBuffer, inputSchema) {
|
|
3688
|
-
if (inputSchema instanceof Object === false) {
|
|
3689
|
-
return {
|
|
3690
|
-
verified: false,
|
|
3691
|
-
result: { error: "Wrong ASN.1 schema type" }
|
|
3692
|
-
};
|
|
3693
|
-
}
|
|
3694
|
-
const asn1 = localFromBER(pvtsutils__namespace.BufferSourceConverter.toUint8Array(inputBuffer));
|
|
3695
|
-
if (asn1.offset === -1) {
|
|
3696
|
-
return {
|
|
3697
|
-
verified: false,
|
|
3698
|
-
result: asn1.result
|
|
3699
|
-
};
|
|
3700
|
-
}
|
|
3701
|
-
return compareSchema(asn1.result, asn1.result, inputSchema);
|
|
3702
|
-
}
|
|
3703
|
-
|
|
3704
|
-
registerBuiltinEncoder({ BitString, Integer, OctetString, Primitive, Constructed, Sequence, Set }, {
|
|
3705
|
-
BaseBlock,
|
|
3706
|
-
ViewWriter,
|
|
3707
|
-
LocalIdentificationBlock,
|
|
3708
|
-
LocalLengthBlock,
|
|
3709
|
-
LocalIntegerValueBlock,
|
|
3710
|
-
LocalOctetStringValueBlock,
|
|
3711
|
-
LocalConstructedValueBlock,
|
|
3712
|
-
LocalBitStringValueBlock,
|
|
3713
|
-
LocalPrimitiveValueBlock,
|
|
3714
|
-
originalBaseBlockToBER: ORIGINAL_BASE_BLOCK_TO_BER,
|
|
3715
|
-
originalWriterWrite: ORIGINAL_VIEW_WRITER_WRITE,
|
|
3716
|
-
originalWriterFinal: ORIGINAL_VIEW_WRITER_FINAL,
|
|
3717
|
-
originalIdentificationToBER: ORIGINAL_LOCAL_IDENTIFICATION_TO_BER,
|
|
3718
|
-
originalLengthToBER: ORIGINAL_LOCAL_LENGTH_TO_BER,
|
|
3719
|
-
originalIntegerToBER: ORIGINAL_LOCAL_INTEGER_TO_BER,
|
|
3720
|
-
originalOctetStringToBER: ORIGINAL_LOCAL_OCTET_STRING_TO_BER,
|
|
3721
|
-
originalBitStringToBER: ORIGINAL_LOCAL_BIT_STRING_TO_BER,
|
|
3722
|
-
originalConstructedToBER: ORIGINAL_LOCAL_CONSTRUCTED_TO_BER,
|
|
3723
|
-
originalPrimitiveToBER: ORIGINAL_LOCAL_PRIMITIVE_TO_BER
|
|
3724
|
-
});
|
|
3725
|
-
registerFastParser({ Integer, Null, Sequence });
|
|
3726
|
-
|
|
3727
|
-
exports.Any = Any;
|
|
3728
|
-
exports.BaseBlock = BaseBlock;
|
|
3729
|
-
exports.BaseStringBlock = BaseStringBlock;
|
|
3730
|
-
exports.BitString = BitString;
|
|
3731
|
-
exports.BmpString = BmpString;
|
|
3732
|
-
exports.Boolean = Boolean;
|
|
3733
|
-
exports.CharacterString = CharacterString;
|
|
3734
|
-
exports.Choice = Choice;
|
|
3735
|
-
exports.Constructed = Constructed;
|
|
3736
|
-
exports.DATE = DATE;
|
|
3737
|
-
exports.DEFAULT_MAX_CONTENT_LENGTH = DEFAULT_MAX_CONTENT_LENGTH;
|
|
3738
|
-
exports.DEFAULT_MAX_DEPTH = DEFAULT_MAX_DEPTH;
|
|
3739
|
-
exports.DEFAULT_MAX_NODES = DEFAULT_MAX_NODES;
|
|
3740
|
-
exports.DateTime = DateTime;
|
|
3741
|
-
exports.Duration = Duration;
|
|
3742
|
-
exports.EndOfContent = EndOfContent;
|
|
3743
|
-
exports.Enumerated = Enumerated;
|
|
3744
|
-
exports.GeneralString = GeneralString;
|
|
3745
|
-
exports.GeneralizedTime = GeneralizedTime;
|
|
3746
|
-
exports.GraphicString = GraphicString;
|
|
3747
|
-
exports.HexBlock = HexBlock;
|
|
3748
|
-
exports.IA5String = IA5String;
|
|
3749
|
-
exports.Integer = Integer;
|
|
3750
|
-
exports.Null = Null;
|
|
3751
|
-
exports.NumericString = NumericString;
|
|
3752
|
-
exports.ObjectIdentifier = ObjectIdentifier;
|
|
3753
|
-
exports.OctetString = OctetString;
|
|
3754
|
-
exports.Primitive = Primitive;
|
|
3755
|
-
exports.PrintableString = PrintableString;
|
|
3756
|
-
exports.RawData = RawData;
|
|
3757
|
-
exports.RelativeObjectIdentifier = RelativeObjectIdentifier;
|
|
3758
|
-
exports.Repeated = Repeated;
|
|
3759
|
-
exports.Sequence = Sequence;
|
|
3760
|
-
exports.Set = Set;
|
|
3761
|
-
exports.TIME = TIME;
|
|
3762
|
-
exports.TeletexString = TeletexString;
|
|
3763
|
-
exports.TimeOfDay = TimeOfDay;
|
|
3764
|
-
exports.UTCTime = UTCTime;
|
|
3765
|
-
exports.UniversalString = UniversalString;
|
|
3766
|
-
exports.Utf8String = Utf8String;
|
|
3767
|
-
exports.ValueBlock = ValueBlock;
|
|
3768
|
-
exports.VideotexString = VideotexString;
|
|
3769
|
-
exports.ViewWriter = ViewWriter;
|
|
3770
|
-
exports.VisibleString = VisibleString;
|
|
3771
|
-
exports.compareSchema = compareSchema;
|
|
3772
|
-
exports.fromBER = fromBER;
|
|
3773
|
-
exports.verifySchema = verifySchema;
|