@wirebench/engine 2.1.1
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/LICENSE +201 -0
- package/README.md +3 -0
- package/dist/assert/contract.d.ts +3 -0
- package/dist/assert/contract.js +17 -0
- package/dist/assert/index.d.ts +4 -0
- package/dist/assert/index.js +27 -0
- package/dist/assert/match.d.ts +3 -0
- package/dist/assert/match.js +58 -0
- package/dist/assert/model.d.ts +73 -0
- package/dist/assert/model.js +8 -0
- package/dist/assert/schema.d.ts +34 -0
- package/dist/assert/schema.js +46 -0
- package/dist/assert/sla.d.ts +3 -0
- package/dist/assert/sla.js +8 -0
- package/dist/assert/soap-fault.d.ts +3 -0
- package/dist/assert/soap-fault.js +20 -0
- package/dist/assert/status.d.ts +3 -0
- package/dist/assert/status.js +14 -0
- package/dist/errors.d.ts +77 -0
- package/dist/errors.js +121 -0
- package/dist/fs.d.ts +35 -0
- package/dist/fs.js +64 -0
- package/dist/generate.d.ts +12 -0
- package/dist/generate.js +14 -0
- package/dist/grpc/browser.d.ts +11 -0
- package/dist/grpc/browser.js +9 -0
- package/dist/grpc/cache.d.ts +113 -0
- package/dist/grpc/cache.js +244 -0
- package/dist/grpc/call.d.ts +64 -0
- package/dist/grpc/call.js +72 -0
- package/dist/grpc/codec.d.ts +29 -0
- package/dist/grpc/codec.js +416 -0
- package/dist/grpc/command.d.ts +23 -0
- package/dist/grpc/command.js +91 -0
- package/dist/grpc/expand.d.ts +25 -0
- package/dist/grpc/expand.js +52 -0
- package/dist/grpc/framing.d.ts +28 -0
- package/dist/grpc/framing.js +61 -0
- package/dist/grpc/import.d.ts +47 -0
- package/dist/grpc/import.js +88 -0
- package/dist/grpc/model.d.ts +179 -0
- package/dist/grpc/model.js +91 -0
- package/dist/grpc/proto/describe.d.ts +92 -0
- package/dist/grpc/proto/describe.js +205 -0
- package/dist/grpc/proto/load.d.ts +35 -0
- package/dist/grpc/proto/load.js +112 -0
- package/dist/grpc/proto/sample.d.ts +21 -0
- package/dist/grpc/proto/sample.js +79 -0
- package/dist/grpc/proto/well-known.d.ts +42 -0
- package/dist/grpc/proto/well-known.js +143 -0
- package/dist/grpc/reconcile.d.ts +42 -0
- package/dist/grpc/reconcile.js +153 -0
- package/dist/grpc/reflection/client.d.ts +70 -0
- package/dist/grpc/reflection/client.js +197 -0
- package/dist/grpc/reflection/descriptors.d.ts +69 -0
- package/dist/grpc/reflection/descriptors.js +140 -0
- package/dist/grpc/reflection/proto.d.ts +33 -0
- package/dist/grpc/reflection/proto.js +144 -0
- package/dist/grpc/send.d.ts +132 -0
- package/dist/grpc/send.js +435 -0
- package/dist/grpc/shape.d.ts +29 -0
- package/dist/grpc/shape.js +36 -0
- package/dist/grpc/status.d.ts +21 -0
- package/dist/grpc/status.js +62 -0
- package/dist/grpc/target.d.ts +21 -0
- package/dist/grpc/target.js +66 -0
- package/dist/http/auth/apply.d.ts +37 -0
- package/dist/http/auth/apply.js +74 -0
- package/dist/http/auth/basic.d.ts +36 -0
- package/dist/http/auth/basic.js +69 -0
- package/dist/http/auth/md4.d.ts +13 -0
- package/dist/http/auth/md4.js +81 -0
- package/dist/http/auth/ntlm-transport.d.ts +61 -0
- package/dist/http/auth/ntlm-transport.js +97 -0
- package/dist/http/auth/ntlm.d.ts +190 -0
- package/dist/http/auth/ntlm.js +377 -0
- package/dist/http/client.d.ts +73 -0
- package/dist/http/client.js +403 -0
- package/dist/http/curl-flags.d.ts +15 -0
- package/dist/http/curl-flags.js +95 -0
- package/dist/http/curl.d.ts +94 -0
- package/dist/http/curl.js +245 -0
- package/dist/http/decompress.d.ts +7 -0
- package/dist/http/decompress.js +22 -0
- package/dist/http/errors.d.ts +22 -0
- package/dist/http/errors.js +144 -0
- package/dist/http/failed-request.d.ts +27 -0
- package/dist/http/failed-request.js +48 -0
- package/dist/http/headers.d.ts +15 -0
- package/dist/http/headers.js +50 -0
- package/dist/http/heredoc.d.ts +25 -0
- package/dist/http/heredoc.js +74 -0
- package/dist/http/proxy.d.ts +103 -0
- package/dist/http/proxy.js +168 -0
- package/dist/http/raw-capture.d.ts +23 -0
- package/dist/http/raw-capture.js +57 -0
- package/dist/http/timings.d.ts +79 -0
- package/dist/http/timings.js +212 -0
- package/dist/http/tls.d.ts +111 -0
- package/dist/http/tls.js +167 -0
- package/dist/http/types.d.ts +125 -0
- package/dist/http/types.js +6 -0
- package/dist/import-detect.d.ts +26 -0
- package/dist/import-detect.js +169 -0
- package/dist/import.d.ts +20 -0
- package/dist/import.js +163 -0
- package/dist/index.d.ts +272 -0
- package/dist/index.js +157 -0
- package/dist/json/cursor.d.ts +43 -0
- package/dist/json/cursor.js +168 -0
- package/dist/operations.d.ts +12 -0
- package/dist/operations.js +52 -0
- package/dist/project/attachments-cache.d.ts +80 -0
- package/dist/project/attachments-cache.js +186 -0
- package/dist/project/endpoints.d.ts +23 -0
- package/dist/project/endpoints.js +47 -0
- package/dist/project/environments.d.ts +68 -0
- package/dist/project/environments.js +124 -0
- package/dist/project/fs.d.ts +45 -0
- package/dist/project/fs.js +78 -0
- package/dist/project/history.d.ts +171 -0
- package/dist/project/history.js +179 -0
- package/dist/project/keystores.d.ts +24 -0
- package/dist/project/keystores.js +66 -0
- package/dist/project/load.d.ts +44 -0
- package/dist/project/load.js +634 -0
- package/dist/project/migrate.d.ts +27 -0
- package/dist/project/migrate.js +46 -0
- package/dist/project/model.d.ts +401 -0
- package/dist/project/model.js +126 -0
- package/dist/project/paths.d.ts +134 -0
- package/dist/project/paths.js +259 -0
- package/dist/project/preferences.d.ts +318 -0
- package/dist/project/preferences.js +239 -0
- package/dist/project/properties.d.ts +97 -0
- package/dist/project/properties.js +356 -0
- package/dist/project/save.d.ts +65 -0
- package/dist/project/save.js +295 -0
- package/dist/project/schema.d.ts +1329 -0
- package/dist/project/schema.js +737 -0
- package/dist/project/serialize.d.ts +42 -0
- package/dist/project/serialize.js +385 -0
- package/dist/project/wss-configs.d.ts +40 -0
- package/dist/project/wss-configs.js +142 -0
- package/dist/project/yaml.d.ts +17 -0
- package/dist/project/yaml.js +39 -0
- package/dist/redact/index.d.ts +77 -0
- package/dist/redact/index.js +328 -0
- package/dist/redact/literal.d.ts +12 -0
- package/dist/redact/literal.js +68 -0
- package/dist/rest/auth.d.ts +53 -0
- package/dist/rest/auth.js +80 -0
- package/dist/rest/body.d.ts +61 -0
- package/dist/rest/body.js +184 -0
- package/dist/rest/browser.d.ts +12 -0
- package/dist/rest/browser.js +11 -0
- package/dist/rest/cookies.d.ts +41 -0
- package/dist/rest/cookies.js +102 -0
- package/dist/rest/curl.d.ts +75 -0
- package/dist/rest/curl.js +417 -0
- package/dist/rest/expand.d.ts +35 -0
- package/dist/rest/expand.js +104 -0
- package/dist/rest/model.d.ts +247 -0
- package/dist/rest/model.js +118 -0
- package/dist/rest/oauth2.d.ts +118 -0
- package/dist/rest/oauth2.js +212 -0
- package/dist/rest/openapi/cache.d.ts +54 -0
- package/dist/rest/openapi/cache.js +128 -0
- package/dist/rest/openapi/import.d.ts +67 -0
- package/dist/rest/openapi/import.js +91 -0
- package/dist/rest/openapi/map.d.ts +102 -0
- package/dist/rest/openapi/map.js +477 -0
- package/dist/rest/openapi/model.d.ts +203 -0
- package/dist/rest/openapi/model.js +37 -0
- package/dist/rest/openapi/parse.d.ts +44 -0
- package/dist/rest/openapi/parse.js +1530 -0
- package/dist/rest/openapi/refs.d.ts +63 -0
- package/dist/rest/openapi/refs.js +258 -0
- package/dist/rest/openapi/sample.d.ts +68 -0
- package/dist/rest/openapi/sample.js +336 -0
- package/dist/rest/postman/import.d.ts +21 -0
- package/dist/rest/postman/import.js +47 -0
- package/dist/rest/postman/index.d.ts +7 -0
- package/dist/rest/postman/index.js +7 -0
- package/dist/rest/postman/map.d.ts +28 -0
- package/dist/rest/postman/map.js +427 -0
- package/dist/rest/postman/model.d.ts +118 -0
- package/dist/rest/postman/model.js +7 -0
- package/dist/rest/postman/parse.d.ts +29 -0
- package/dist/rest/postman/parse.js +518 -0
- package/dist/rest/response.d.ts +72 -0
- package/dist/rest/response.js +221 -0
- package/dist/rest/send.d.ts +102 -0
- package/dist/rest/send.js +148 -0
- package/dist/rest/url.d.ts +92 -0
- package/dist/rest/url.js +213 -0
- package/dist/run/effective-auth.d.ts +10 -0
- package/dist/run/effective-auth.js +19 -0
- package/dist/run/index.d.ts +8 -0
- package/dist/run/index.js +4 -0
- package/dist/run/prepare.d.ts +43 -0
- package/dist/run/prepare.js +280 -0
- package/dist/run/run.d.ts +53 -0
- package/dist/run/run.js +223 -0
- package/dist/run/secret-needs.d.ts +13 -0
- package/dist/run/secret-needs.js +125 -0
- package/dist/run/select.d.ts +34 -0
- package/dist/run/select.js +76 -0
- package/dist/secrets/env-names.d.ts +27 -0
- package/dist/secrets/env-names.js +40 -0
- package/dist/secrets/resolve.d.ts +58 -0
- package/dist/secrets/resolve.js +136 -0
- package/dist/send-options.d.ts +141 -0
- package/dist/send-options.js +228 -0
- package/dist/send.d.ts +53 -0
- package/dist/send.js +210 -0
- package/dist/soap/body-builder.d.ts +38 -0
- package/dist/soap/body-builder.js +250 -0
- package/dist/soap/build-problems.d.ts +12 -0
- package/dist/soap/build-problems.js +2 -0
- package/dist/soap/charset.d.ts +23 -0
- package/dist/soap/charset.js +47 -0
- package/dist/soap/envelope.d.ts +44 -0
- package/dist/soap/envelope.js +76 -0
- package/dist/soap/fault.d.ts +46 -0
- package/dist/soap/fault.js +129 -0
- package/dist/soap/form-request.d.ts +34 -0
- package/dist/soap/form-request.js +251 -0
- package/dist/soap/legacy-project/definition-fetcher.d.ts +21 -0
- package/dist/soap/legacy-project/definition-fetcher.js +43 -0
- package/dist/soap/legacy-project/format.d.ts +18 -0
- package/dist/soap/legacy-project/format.js +24 -0
- package/dist/soap/legacy-project/import.d.ts +21 -0
- package/dist/soap/legacy-project/import.js +46 -0
- package/dist/soap/legacy-project/index.d.ts +9 -0
- package/dist/soap/legacy-project/index.js +5 -0
- package/dist/soap/legacy-project/map.d.ts +91 -0
- package/dist/soap/legacy-project/map.js +290 -0
- package/dist/soap/legacy-project/model.d.ts +98 -0
- package/dist/soap/legacy-project/model.js +5 -0
- package/dist/soap/legacy-project/parse.d.ts +16 -0
- package/dist/soap/legacy-project/parse.js +325 -0
- package/dist/soap/mime/cid-scan.d.ts +36 -0
- package/dist/soap/mime/cid-scan.js +52 -0
- package/dist/soap/mime/inline-files.d.ts +39 -0
- package/dist/soap/mime/inline-files.js +71 -0
- package/dist/soap/mime/mtom.d.ts +74 -0
- package/dist/soap/mime/mtom.js +134 -0
- package/dist/soap/mime/multipart.d.ts +66 -0
- package/dist/soap/mime/multipart.js +329 -0
- package/dist/soap/mime/send-pipeline.d.ts +61 -0
- package/dist/soap/mime/send-pipeline.js +145 -0
- package/dist/soap/mime/swa.d.ts +45 -0
- package/dist/soap/mime/swa.js +62 -0
- package/dist/soap/mime/types.d.ts +69 -0
- package/dist/soap/mime/types.js +10 -0
- package/dist/soap/namespace-scope.d.ts +32 -0
- package/dist/soap/namespace-scope.js +85 -0
- package/dist/soap/prefixes.d.ts +24 -0
- package/dist/soap/prefixes.js +70 -0
- package/dist/soap/recreate.d.ts +28 -0
- package/dist/soap/recreate.js +168 -0
- package/dist/soap/request-builder.d.ts +63 -0
- package/dist/soap/request-builder.js +161 -0
- package/dist/soap/response-parser.d.ts +29 -0
- package/dist/soap/response-parser.js +71 -0
- package/dist/soap/soap-action.d.ts +31 -0
- package/dist/soap/soap-action.js +28 -0
- package/dist/soap/transforms.d.ts +52 -0
- package/dist/soap/transforms.js +164 -0
- package/dist/types.d.ts +307 -0
- package/dist/types.js +6 -0
- package/dist/validate/index.d.ts +61 -0
- package/dist/validate/index.js +72 -0
- package/dist/validate/schema-file-set.d.ts +51 -0
- package/dist/validate/schema-file-set.js +288 -0
- package/dist/validate/schema-validator.d.ts +53 -0
- package/dist/validate/schema-validator.js +251 -0
- package/dist/validate/soap-structure.d.ts +34 -0
- package/dist/validate/soap-structure.js +255 -0
- package/dist/validate/types.d.ts +47 -0
- package/dist/validate/types.js +8 -0
- package/dist/validate/wsi/assertions/helpers.d.ts +145 -0
- package/dist/validate/wsi/assertions/helpers.js +387 -0
- package/dist/validate/wsi/assertions/index.d.ts +44 -0
- package/dist/validate/wsi/assertions/index.js +77 -0
- package/dist/validate/wsi/assertions/message/helpers.d.ts +63 -0
- package/dist/validate/wsi/assertions/message/helpers.js +168 -0
- package/dist/validate/wsi/assertions/message/index.d.ts +39 -0
- package/dist/validate/wsi/assertions/message/index.js +62 -0
- package/dist/validate/wsi/assertions/message/r1001.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1001.js +38 -0
- package/dist/validate/wsi/assertions/message/r1003.d.ts +14 -0
- package/dist/validate/wsi/assertions/message/r1003.js +45 -0
- package/dist/validate/wsi/assertions/message/r1005.d.ts +12 -0
- package/dist/validate/wsi/assertions/message/r1005.js +37 -0
- package/dist/validate/wsi/assertions/message/r1006.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1006.js +49 -0
- package/dist/validate/wsi/assertions/message/r1007.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1007.js +30 -0
- package/dist/validate/wsi/assertions/message/r1011.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1011.js +33 -0
- package/dist/validate/wsi/assertions/message/r1012.d.ts +13 -0
- package/dist/validate/wsi/assertions/message/r1012.js +37 -0
- package/dist/validate/wsi/assertions/message/r1013.d.ts +9 -0
- package/dist/validate/wsi/assertions/message/r1013.js +42 -0
- package/dist/validate/wsi/assertions/message/r1014.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1014.js +30 -0
- package/dist/validate/wsi/assertions/message/r1015.d.ts +12 -0
- package/dist/validate/wsi/assertions/message/r1015.js +36 -0
- package/dist/validate/wsi/assertions/message/r1017.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1017.js +30 -0
- package/dist/validate/wsi/assertions/message/r1100.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1100.js +39 -0
- package/dist/validate/wsi/assertions/message/r1101.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1101.js +37 -0
- package/dist/validate/wsi/assertions/message/r1102.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1102.js +41 -0
- package/dist/validate/wsi/assertions/message/r1103.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1103.js +28 -0
- package/dist/validate/wsi/assertions/message/r1107.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1107.js +38 -0
- package/dist/validate/wsi/assertions/message/r1109.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1109.js +32 -0
- package/dist/validate/wsi/assertions/message/r1124.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1124.js +31 -0
- package/dist/validate/wsi/assertions/message/r1132.d.ts +9 -0
- package/dist/validate/wsi/assertions/message/r1132.js +23 -0
- package/dist/validate/wsi/assertions/message/r1140.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1140.js +42 -0
- package/dist/validate/wsi/assertions/message/r1141.d.ts +10 -0
- package/dist/validate/wsi/assertions/message/r1141.js +32 -0
- package/dist/validate/wsi/assertions/message/r2113.d.ts +11 -0
- package/dist/validate/wsi/assertions/message/r2113.js +33 -0
- package/dist/validate/wsi/assertions/message/r2211.d.ts +7 -0
- package/dist/validate/wsi/assertions/message/r2211.js +42 -0
- package/dist/validate/wsi/assertions/r2001.d.ts +15 -0
- package/dist/validate/wsi/assertions/r2001.js +47 -0
- package/dist/validate/wsi/assertions/r2002.d.ts +11 -0
- package/dist/validate/wsi/assertions/r2002.js +38 -0
- package/dist/validate/wsi/assertions/r2003.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2003.js +32 -0
- package/dist/validate/wsi/assertions/r2005.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2005.js +40 -0
- package/dist/validate/wsi/assertions/r2101.d.ts +14 -0
- package/dist/validate/wsi/assertions/r2101.js +65 -0
- package/dist/validate/wsi/assertions/r2102.d.ts +10 -0
- package/dist/validate/wsi/assertions/r2102.js +41 -0
- package/dist/validate/wsi/assertions/r2105.d.ts +8 -0
- package/dist/validate/wsi/assertions/r2105.js +39 -0
- package/dist/validate/wsi/assertions/r2110.d.ts +8 -0
- package/dist/validate/wsi/assertions/r2110.js +38 -0
- package/dist/validate/wsi/assertions/r2111.d.ts +6 -0
- package/dist/validate/wsi/assertions/r2111.js +30 -0
- package/dist/validate/wsi/assertions/r2112.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2112.js +35 -0
- package/dist/validate/wsi/assertions/r2201.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2201.js +28 -0
- package/dist/validate/wsi/assertions/r2203.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2203.js +30 -0
- package/dist/validate/wsi/assertions/r2204.d.ts +6 -0
- package/dist/validate/wsi/assertions/r2204.js +29 -0
- package/dist/validate/wsi/assertions/r2205.d.ts +8 -0
- package/dist/validate/wsi/assertions/r2205.js +46 -0
- package/dist/validate/wsi/assertions/r2206.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2206.js +36 -0
- package/dist/validate/wsi/assertions/r2209.d.ts +12 -0
- package/dist/validate/wsi/assertions/r2209.js +37 -0
- package/dist/validate/wsi/assertions/r2210.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2210.js +30 -0
- package/dist/validate/wsi/assertions/r2303.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2303.js +44 -0
- package/dist/validate/wsi/assertions/r2304.d.ts +6 -0
- package/dist/validate/wsi/assertions/r2304.js +32 -0
- package/dist/validate/wsi/assertions/r2401.d.ts +12 -0
- package/dist/validate/wsi/assertions/r2401.js +31 -0
- package/dist/validate/wsi/assertions/r2701.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2701.js +28 -0
- package/dist/validate/wsi/assertions/r2702.d.ts +6 -0
- package/dist/validate/wsi/assertions/r2702.js +26 -0
- package/dist/validate/wsi/assertions/r2705.d.ts +11 -0
- package/dist/validate/wsi/assertions/r2705.js +31 -0
- package/dist/validate/wsi/assertions/r2706.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2706.js +29 -0
- package/dist/validate/wsi/assertions/r2710.d.ts +13 -0
- package/dist/validate/wsi/assertions/r2710.js +37 -0
- package/dist/validate/wsi/assertions/r2716.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2716.js +29 -0
- package/dist/validate/wsi/assertions/r2717.d.ts +9 -0
- package/dist/validate/wsi/assertions/r2717.js +31 -0
- package/dist/validate/wsi/assertions/r2718.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2718.js +41 -0
- package/dist/validate/wsi/assertions/r2720.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2720.js +29 -0
- package/dist/validate/wsi/assertions/r2721.d.ts +6 -0
- package/dist/validate/wsi/assertions/r2721.js +27 -0
- package/dist/validate/wsi/assertions/r2722.d.ts +6 -0
- package/dist/validate/wsi/assertions/r2722.js +29 -0
- package/dist/validate/wsi/assertions/r2801.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2801.js +39 -0
- package/dist/validate/wsi/assertions/r2803.d.ts +7 -0
- package/dist/validate/wsi/assertions/r2803.js +29 -0
- package/dist/validate/wsi/docs.d.ts +29 -0
- package/dist/validate/wsi/docs.js +167 -0
- package/dist/validate/wsi/index.d.ts +16 -0
- package/dist/validate/wsi/index.js +11 -0
- package/dist/validate/wsi/report-html.d.ts +36 -0
- package/dist/validate/wsi/report-html.js +135 -0
- package/dist/validate/wsi/run-message.d.ts +50 -0
- package/dist/validate/wsi/run-message.js +190 -0
- package/dist/validate/wsi/run-wsdl.d.ts +48 -0
- package/dist/validate/wsi/run-wsdl.js +99 -0
- package/dist/validate/wsi/types.d.ts +173 -0
- package/dist/validate/wsi/types.js +17 -0
- package/dist/workspace/commit-message.d.ts +47 -0
- package/dist/workspace/commit-message.js +195 -0
- package/dist/workspace/environments.d.ts +79 -0
- package/dist/workspace/environments.js +115 -0
- package/dist/workspace/index.d.ts +28 -0
- package/dist/workspace/index.js +19 -0
- package/dist/workspace/load.d.ts +45 -0
- package/dist/workspace/load.js +155 -0
- package/dist/workspace/local-state.d.ts +37 -0
- package/dist/workspace/local-state.js +59 -0
- package/dist/workspace/migrate.d.ts +38 -0
- package/dist/workspace/migrate.js +50 -0
- package/dist/workspace/model.d.ts +86 -0
- package/dist/workspace/model.js +54 -0
- package/dist/workspace/paths.d.ts +64 -0
- package/dist/workspace/paths.js +97 -0
- package/dist/workspace/reidentify.d.ts +22 -0
- package/dist/workspace/reidentify.js +122 -0
- package/dist/workspace/save.d.ts +31 -0
- package/dist/workspace/save.js +84 -0
- package/dist/workspace/schema.d.ts +93 -0
- package/dist/workspace/schema.js +115 -0
- package/dist/workspace/serialize.d.ts +24 -0
- package/dist/workspace/serialize.js +60 -0
- package/dist/workspace/share.d.ts +52 -0
- package/dist/workspace/share.js +89 -0
- package/dist/ws/browser.d.ts +13 -0
- package/dist/ws/browser.js +11 -0
- package/dist/ws/call.d.ts +53 -0
- package/dist/ws/call.js +106 -0
- package/dist/ws/command.d.ts +19 -0
- package/dist/ws/command.js +28 -0
- package/dist/ws/expand.d.ts +38 -0
- package/dist/ws/expand.js +76 -0
- package/dist/ws/model.d.ts +191 -0
- package/dist/ws/model.js +83 -0
- package/dist/ws/pretty.d.ts +12 -0
- package/dist/ws/pretty.js +25 -0
- package/dist/ws/session.d.ts +50 -0
- package/dist/ws/session.js +333 -0
- package/dist/ws/shape.d.ts +18 -0
- package/dist/ws/shape.js +28 -0
- package/dist/ws/transcript.d.ts +14 -0
- package/dist/ws/transcript.js +29 -0
- package/dist/ws/url.d.ts +3 -0
- package/dist/ws/url.js +44 -0
- package/dist/wsa/headers.d.ts +78 -0
- package/dist/wsa/headers.js +244 -0
- package/dist/wsa/model.d.ts +66 -0
- package/dist/wsa/model.js +52 -0
- package/dist/wsa/policy-detect.d.ts +81 -0
- package/dist/wsa/policy-detect.js +245 -0
- package/dist/wsdl/cache-naming.d.ts +39 -0
- package/dist/wsdl/cache-naming.js +90 -0
- package/dist/wsdl/cache.d.ts +48 -0
- package/dist/wsdl/cache.js +141 -0
- package/dist/wsdl/docs-generator.d.ts +47 -0
- package/dist/wsdl/docs-generator.js +439 -0
- package/dist/wsdl/dom-utils.d.ts +15 -0
- package/dist/wsdl/dom-utils.js +50 -0
- package/dist/wsdl/export-definition.d.ts +38 -0
- package/dist/wsdl/export-definition.js +100 -0
- package/dist/wsdl/fetch.d.ts +13 -0
- package/dist/wsdl/fetch.js +60 -0
- package/dist/wsdl/merge.d.ts +17 -0
- package/dist/wsdl/merge.js +57 -0
- package/dist/wsdl/model.d.ts +176 -0
- package/dist/wsdl/model.js +17 -0
- package/dist/wsdl/parse-binding.d.ts +6 -0
- package/dist/wsdl/parse-binding.js +150 -0
- package/dist/wsdl/parse-wsdl.d.ts +47 -0
- package/dist/wsdl/parse-wsdl.js +161 -0
- package/dist/wsdl/qname.d.ts +28 -0
- package/dist/wsdl/qname.js +41 -0
- package/dist/wsdl/ref-policy.d.ts +54 -0
- package/dist/wsdl/ref-policy.js +87 -0
- package/dist/wsdl/resolver.d.ts +81 -0
- package/dist/wsdl/resolver.js +276 -0
- package/dist/wsdl/update-definition.d.ts +106 -0
- package/dist/wsdl/update-definition.js +314 -0
- package/dist/wss/apply.d.ts +40 -0
- package/dist/wss/apply.js +212 -0
- package/dist/wss/c14n-prefixes.d.ts +27 -0
- package/dist/wss/c14n-prefixes.js +95 -0
- package/dist/wss/incoming/decrypt.d.ts +35 -0
- package/dist/wss/incoming/decrypt.js +57 -0
- package/dist/wss/incoming/index.d.ts +56 -0
- package/dist/wss/incoming/index.js +189 -0
- package/dist/wss/incoming/verify.d.ts +74 -0
- package/dist/wss/incoming/verify.js +440 -0
- package/dist/wss/key-identifiers.d.ts +76 -0
- package/dist/wss/key-identifiers.js +139 -0
- package/dist/wss/keystore/certificate.d.ts +45 -0
- package/dist/wss/keystore/certificate.js +134 -0
- package/dist/wss/keystore/index.d.ts +50 -0
- package/dist/wss/keystore/index.js +80 -0
- package/dist/wss/keystore/model.d.ts +83 -0
- package/dist/wss/keystore/model.js +27 -0
- package/dist/wss/keystore/pem.d.ts +21 -0
- package/dist/wss/keystore/pem.js +140 -0
- package/dist/wss/keystore/pkcs12.d.ts +21 -0
- package/dist/wss/keystore/pkcs12.js +125 -0
- package/dist/wss/model.d.ts +160 -0
- package/dist/wss/model.js +37 -0
- package/dist/wss/outgoing/encryption.d.ts +76 -0
- package/dist/wss/outgoing/encryption.js +618 -0
- package/dist/wss/outgoing/signature.d.ts +73 -0
- package/dist/wss/outgoing/signature.js +239 -0
- package/dist/wss/outgoing/timestamp.d.ts +29 -0
- package/dist/wss/outgoing/timestamp.js +39 -0
- package/dist/wss/outgoing/username-token.d.ts +36 -0
- package/dist/wss/outgoing/username-token.js +68 -0
- package/dist/wss/security-header.d.ts +31 -0
- package/dist/wss/security-header.js +83 -0
- package/dist/xml/index.d.ts +7 -0
- package/dist/xml/index.js +7 -0
- package/dist/xml/namespaces.d.ts +36 -0
- package/dist/xml/namespaces.js +60 -0
- package/dist/xml/parse.d.ts +79 -0
- package/dist/xml/parse.js +109 -0
- package/dist/xml/positions.d.ts +26 -0
- package/dist/xml/positions.js +71 -0
- package/dist/xml/pretty.d.ts +37 -0
- package/dist/xml/pretty.js +137 -0
- package/dist/xml/serialize.d.ts +6 -0
- package/dist/xml/serialize.js +8 -0
- package/dist/xml/tolerant-tree.d.ts +56 -0
- package/dist/xml/tolerant-tree.js +134 -0
- package/dist/xpath/evaluate-async.d.ts +31 -0
- package/dist/xpath/evaluate-async.js +81 -0
- package/dist/xpath/evaluate.d.ts +98 -0
- package/dist/xpath/evaluate.js +340 -0
- package/dist/xpath/jsonpath.d.ts +40 -0
- package/dist/xpath/jsonpath.js +109 -0
- package/dist/xpath/namespaces.d.ts +29 -0
- package/dist/xpath/namespaces.js +101 -0
- package/dist/xpath/worker.d.ts +7 -0
- package/dist/xpath/worker.js +26 -0
- package/dist/xsd/builtins.d.ts +36 -0
- package/dist/xsd/builtins.js +108 -0
- package/dist/xsd/check-references.d.ts +25 -0
- package/dist/xsd/check-references.js +145 -0
- package/dist/xsd/form-edits.d.ts +57 -0
- package/dist/xsd/form-edits.js +153 -0
- package/dist/xsd/form-model.d.ts +153 -0
- package/dist/xsd/form-model.js +691 -0
- package/dist/xsd/locate.d.ts +42 -0
- package/dist/xsd/locate.js +249 -0
- package/dist/xsd/model.d.ts +249 -0
- package/dist/xsd/model.js +1 -0
- package/dist/xsd/parse-particles.d.ts +48 -0
- package/dist/xsd/parse-particles.js +320 -0
- package/dist/xsd/parse-schema.d.ts +21 -0
- package/dist/xsd/parse-schema.js +143 -0
- package/dist/xsd/resolve-content.d.ts +18 -0
- package/dist/xsd/resolve-content.js +242 -0
- package/dist/xsd/sample-generator.d.ts +51 -0
- package/dist/xsd/sample-generator.js +291 -0
- package/dist/xsd/sample-types.d.ts +21 -0
- package/dist/xsd/sample-types.js +69 -0
- package/dist/xsd/sample-values.d.ts +54 -0
- package/dist/xsd/sample-values.js +267 -0
- package/dist/xsd/schema-set.d.ts +51 -0
- package/dist/xsd/schema-set.js +203 -0
- package/dist/xsd/xml-scan.d.ts +64 -0
- package/dist/xsd/xml-scan.js +286 -0
- package/dist/xsd/xml-writer.d.ts +56 -0
- package/dist/xsd/xml-writer.js +103 -0
- package/package.json +69 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The certificate metadata both keystore readers need — subject/issuer rendering, validity,
|
|
3
|
+
* serial and fingerprint — kept in one place so a PKCS#12 alias and a PEM alias describe the
|
|
4
|
+
* same certificate identically.
|
|
5
|
+
*/
|
|
6
|
+
import forge from 'node-forge';
|
|
7
|
+
import type { KeystoreAlias } from './model.js';
|
|
8
|
+
/** Renders a forge distinguished name as `CN=…, O=…`, in the certificate's own attribute order. */
|
|
9
|
+
export declare function renderDn(attributes: readonly forge.pki.CertificateField[]): string;
|
|
10
|
+
/**
|
|
11
|
+
* Renders a forge distinguished name in RFC 2253/4514 form: most specific attribute first (the
|
|
12
|
+
* reverse of the certificate's own, least-specific-first order), `,`-separated with no space,
|
|
13
|
+
* and every value escaped per {@link escapeRfc2253Value}.
|
|
14
|
+
*
|
|
15
|
+
* Used only where the DN feeds into a signature (`X509IssuerName` and friends) — the UI keeps
|
|
16
|
+
* using {@link renderDn}, which is easier to read and never needs to round-trip.
|
|
17
|
+
*/
|
|
18
|
+
export declare function renderDnRfc2253(attributes: readonly forge.pki.CertificateField[]): string;
|
|
19
|
+
/** SHA-256 of the DER encoding, as upper-case hex in colon-separated pairs (OpenSSL's rendering). */
|
|
20
|
+
export declare function fingerprintSha256(cert: forge.pki.Certificate): string;
|
|
21
|
+
/** The common name of a certificate's subject, or `undefined` when it has none. */
|
|
22
|
+
export declare function commonNameOf(cert: forge.pki.Certificate): string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* Whether `key` is the private half of `cert`'s public key.
|
|
25
|
+
*
|
|
26
|
+
* Compares the RSA modulus, which is the only public-key field node-forge models for every key
|
|
27
|
+
* type it can parse. `false` whenever the comparison cannot be made at all (a non-RSA key, an
|
|
28
|
+
* unparsable PEM), so a caller pairing a key with a certificate never pairs them *by accident*:
|
|
29
|
+
* "cannot prove they match" and "they do not match" must both mean no.
|
|
30
|
+
*
|
|
31
|
+
* @param key the private key to test
|
|
32
|
+
* @param cert the certificate whose public key it should belong to
|
|
33
|
+
* @returns `true` only when both moduli are present and equal
|
|
34
|
+
*/
|
|
35
|
+
export declare function keyMatchesCertificate(key: forge.pki.PrivateKey, cert: forge.pki.Certificate): boolean;
|
|
36
|
+
/** {@link keyMatchesCertificate} for a key that is still PEM text; `false` when it will not parse. */
|
|
37
|
+
export declare function keyPemMatchesCertificate(keyPem: string, cert: forge.pki.Certificate): boolean;
|
|
38
|
+
/** Everything but the alias name and the key: the certificate half of a {@link KeystoreAlias}. */
|
|
39
|
+
export declare function describeCertificate(cert: forge.pki.Certificate): Omit<KeystoreAlias, 'alias' | 'keyPem' | 'chainPem' | 'hasPrivateKey'>;
|
|
40
|
+
/**
|
|
41
|
+
* The issuer chain of `leaf`, nearest issuer first, walked through `pool`. Stops at a
|
|
42
|
+
* self-signed certificate and never visits the same certificate twice, so a cross-signed pair
|
|
43
|
+
* cannot loop. Certificates it consumed are added to `used`.
|
|
44
|
+
*/
|
|
45
|
+
export declare function buildChain(leaf: forge.pki.Certificate, pool: readonly forge.pki.Certificate[], used: Set<forge.pki.Certificate>): forge.pki.Certificate[];
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The certificate metadata both keystore readers need — subject/issuer rendering, validity,
|
|
3
|
+
* serial and fingerprint — kept in one place so a PKCS#12 alias and a PEM alias describe the
|
|
4
|
+
* same certificate identically.
|
|
5
|
+
*/
|
|
6
|
+
import forge from 'node-forge';
|
|
7
|
+
/** Renders a forge distinguished name as `CN=…, O=…`, in the certificate's own attribute order. */
|
|
8
|
+
export function renderDn(attributes) {
|
|
9
|
+
return attributes
|
|
10
|
+
.map((attribute) => `${attribute.shortName ?? attribute.name ?? attribute.type ?? '?'}=${String(attribute.value)}`)
|
|
11
|
+
.join(', ');
|
|
12
|
+
}
|
|
13
|
+
/** Characters RFC 2253/4514 requires escaping wherever they appear in an attribute value. */
|
|
14
|
+
const RFC2253_ESCAPED_CHARS = new Set([',', '+', '"', '\\', '<', '>', ';', '=']);
|
|
15
|
+
/**
|
|
16
|
+
* Escapes one RFC 2253/4514 attribute value: the always-escaped characters above, a leading
|
|
17
|
+
* `#` or space, a trailing space, and control characters as `\` followed by two hex digits.
|
|
18
|
+
*/
|
|
19
|
+
function escapeRfc2253Value(value) {
|
|
20
|
+
let out = '';
|
|
21
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
22
|
+
const char = value.charAt(index);
|
|
23
|
+
const code = value.charCodeAt(index);
|
|
24
|
+
if (RFC2253_ESCAPED_CHARS.has(char)) {
|
|
25
|
+
out += `\\${char}`;
|
|
26
|
+
}
|
|
27
|
+
else if (code < 0x20 || code === 0x7f) {
|
|
28
|
+
out += `\\${code.toString(16).padStart(2, '0')}`;
|
|
29
|
+
}
|
|
30
|
+
else if ((index === 0 && (char === '#' || char === ' ')) || (index === value.length - 1 && char === ' ')) {
|
|
31
|
+
out += `\\${char}`;
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
out += char;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Renders a forge distinguished name in RFC 2253/4514 form: most specific attribute first (the
|
|
41
|
+
* reverse of the certificate's own, least-specific-first order), `,`-separated with no space,
|
|
42
|
+
* and every value escaped per {@link escapeRfc2253Value}.
|
|
43
|
+
*
|
|
44
|
+
* Used only where the DN feeds into a signature (`X509IssuerName` and friends) — the UI keeps
|
|
45
|
+
* using {@link renderDn}, which is easier to read and never needs to round-trip.
|
|
46
|
+
*/
|
|
47
|
+
export function renderDnRfc2253(attributes) {
|
|
48
|
+
return [...attributes]
|
|
49
|
+
.reverse()
|
|
50
|
+
.map((attribute) => {
|
|
51
|
+
const name = attribute.shortName ?? attribute.name ?? attribute.type ?? '?';
|
|
52
|
+
return `${name}=${escapeRfc2253Value(String(attribute.value))}`;
|
|
53
|
+
})
|
|
54
|
+
.join(',');
|
|
55
|
+
}
|
|
56
|
+
/** SHA-256 of the DER encoding, as upper-case hex in colon-separated pairs (OpenSSL's rendering). */
|
|
57
|
+
export function fingerprintSha256(cert) {
|
|
58
|
+
const der = forge.asn1.toDer(forge.pki.certificateToAsn1(cert)).getBytes();
|
|
59
|
+
const hex = forge.md.sha256.create().update(der).digest().toHex().toUpperCase();
|
|
60
|
+
return (hex.match(/.{2}/g) ?? []).join(':');
|
|
61
|
+
}
|
|
62
|
+
/** The common name of a certificate's subject, or `undefined` when it has none. */
|
|
63
|
+
export function commonNameOf(cert) {
|
|
64
|
+
const field = cert.subject.getField('CN');
|
|
65
|
+
const value = field?.value;
|
|
66
|
+
return typeof value === 'string' && value.length > 0 ? value : undefined;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Whether `key` is the private half of `cert`'s public key.
|
|
70
|
+
*
|
|
71
|
+
* Compares the RSA modulus, which is the only public-key field node-forge models for every key
|
|
72
|
+
* type it can parse. `false` whenever the comparison cannot be made at all (a non-RSA key, an
|
|
73
|
+
* unparsable PEM), so a caller pairing a key with a certificate never pairs them *by accident*:
|
|
74
|
+
* "cannot prove they match" and "they do not match" must both mean no.
|
|
75
|
+
*
|
|
76
|
+
* @param key the private key to test
|
|
77
|
+
* @param cert the certificate whose public key it should belong to
|
|
78
|
+
* @returns `true` only when both moduli are present and equal
|
|
79
|
+
*/
|
|
80
|
+
export function keyMatchesCertificate(key, cert) {
|
|
81
|
+
const modulus = key.n;
|
|
82
|
+
const certModulus = cert.publicKey.n;
|
|
83
|
+
if (modulus === undefined || certModulus === undefined) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
return modulus.toString(16) === certModulus.toString(16);
|
|
87
|
+
}
|
|
88
|
+
/** {@link keyMatchesCertificate} for a key that is still PEM text; `false` when it will not parse. */
|
|
89
|
+
export function keyPemMatchesCertificate(keyPem, cert) {
|
|
90
|
+
try {
|
|
91
|
+
return keyMatchesCertificate(forge.pki.privateKeyFromPem(keyPem), cert);
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/** A DER serial number as upper-case hex, with the leading unsigned-padding byte dropped. */
|
|
98
|
+
function serialOf(cert) {
|
|
99
|
+
const raw = cert.serialNumber.toUpperCase();
|
|
100
|
+
return raw.length > 2 && raw.startsWith('00') ? raw.slice(2) : raw;
|
|
101
|
+
}
|
|
102
|
+
/** Everything but the alias name and the key: the certificate half of a {@link KeystoreAlias}. */
|
|
103
|
+
export function describeCertificate(cert) {
|
|
104
|
+
return {
|
|
105
|
+
certPem: forge.pki.certificateToPem(cert),
|
|
106
|
+
subject: renderDn(cert.subject.attributes),
|
|
107
|
+
issuer: renderDn(cert.issuer.attributes),
|
|
108
|
+
notBefore: cert.validity.notBefore.toISOString(),
|
|
109
|
+
notAfter: cert.validity.notAfter.toISOString(),
|
|
110
|
+
serial: serialOf(cert),
|
|
111
|
+
fingerprintSha256: fingerprintSha256(cert),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* The issuer chain of `leaf`, nearest issuer first, walked through `pool`. Stops at a
|
|
116
|
+
* self-signed certificate and never visits the same certificate twice, so a cross-signed pair
|
|
117
|
+
* cannot loop. Certificates it consumed are added to `used`.
|
|
118
|
+
*/
|
|
119
|
+
export function buildChain(leaf, pool, used) {
|
|
120
|
+
const chain = [];
|
|
121
|
+
let current = leaf;
|
|
122
|
+
for (;;) {
|
|
123
|
+
if (current.isIssuer(current)) {
|
|
124
|
+
return chain;
|
|
125
|
+
}
|
|
126
|
+
const issuer = pool.find((candidate) => candidate !== current && !chain.includes(candidate) && current.isIssuer(candidate));
|
|
127
|
+
if (issuer === undefined) {
|
|
128
|
+
return chain;
|
|
129
|
+
}
|
|
130
|
+
chain.push(issuer);
|
|
131
|
+
used.add(issuer);
|
|
132
|
+
current = issuer;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client keystores: the entry point every caller uses. `loadKeystore` dispatches on the
|
|
3
|
+
* container format, `selectAlias` picks the entry a send should present, and
|
|
4
|
+
* `toTlsClientIdentity` shapes it for `TlsOptions`.
|
|
5
|
+
*/
|
|
6
|
+
import type { Keystore, KeystoreAlias, LoadKeystoreOptions, TlsClientIdentity } from './model.js';
|
|
7
|
+
export { loadPem } from './pem.js';
|
|
8
|
+
export { loadPkcs12 } from './pkcs12.js';
|
|
9
|
+
export { keystoreTypeForPath } from './model.js';
|
|
10
|
+
export type { Keystore, KeystoreAlias, KeystoreDef, KeystoreType, LoadKeystoreOptions, TlsClientIdentity, } from './model.js';
|
|
11
|
+
/**
|
|
12
|
+
* Parses a keystore out of its raw bytes. The engine never reads the file itself: the host
|
|
13
|
+
* checks the path and resolves the password, so containment and secret handling stay in one
|
|
14
|
+
* place (see the module docs on `model.ts`).
|
|
15
|
+
*
|
|
16
|
+
* @param bytes the keystore file's content
|
|
17
|
+
* @param options the container format and, when needed, the password
|
|
18
|
+
* @returns the parsed keystore
|
|
19
|
+
* @throws WssError `keystore-bad-password` or `keystore-invalid`
|
|
20
|
+
*/
|
|
21
|
+
export declare function loadKeystore(bytes: Uint8Array, options: LoadKeystoreOptions): Keystore;
|
|
22
|
+
/**
|
|
23
|
+
* The alias a send should use: the one named, else — when nothing is named — the keystore's
|
|
24
|
+
* only usable entry.
|
|
25
|
+
*
|
|
26
|
+
* `alias` is "the explicit alias, else the registry's `defaultAlias`": the caller collapses
|
|
27
|
+
* those two before calling, because only it knows the registry entry.
|
|
28
|
+
*
|
|
29
|
+
* @param keystore the parsed keystore
|
|
30
|
+
* @param alias the requested alias, or `undefined` to fall back to the only entry
|
|
31
|
+
* @returns the selected alias
|
|
32
|
+
* @throws WssError `keystore-alias-missing` when the name is unknown, or when nothing is named
|
|
33
|
+
* and the keystore holds more (or fewer) than one usable entry
|
|
34
|
+
*/
|
|
35
|
+
export declare function selectAlias(keystore: Keystore, alias?: string): KeystoreAlias;
|
|
36
|
+
/**
|
|
37
|
+
* The client identity for `alias`, shaped for `TlsOptions.cert`/`key`: the leaf with its chain
|
|
38
|
+
* concatenated after it, which is what OpenSSL expects a client to present.
|
|
39
|
+
*
|
|
40
|
+
* The chain is **not** returned as `ca`: `ca` replaces Node's trust store wholesale, so offering
|
|
41
|
+
* a keystore's own issuers as trust anchors would make selecting a client identity quietly stop
|
|
42
|
+
* public certificates from verifying. Whom to trust is configured separately from who to be.
|
|
43
|
+
*
|
|
44
|
+
* @param keystore the parsed keystore
|
|
45
|
+
* @param alias the alias to present, or `undefined` for the keystore's only identity
|
|
46
|
+
* @returns the PEM material for a TLS handshake
|
|
47
|
+
* @throws WssError `keystore-alias-missing` when the alias cannot be resolved, `keystore-invalid`
|
|
48
|
+
* when the resolved alias carries no private key
|
|
49
|
+
*/
|
|
50
|
+
export declare function toTlsClientIdentity(keystore: Keystore, alias?: string): TlsClientIdentity;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client keystores: the entry point every caller uses. `loadKeystore` dispatches on the
|
|
3
|
+
* container format, `selectAlias` picks the entry a send should present, and
|
|
4
|
+
* `toTlsClientIdentity` shapes it for `TlsOptions`.
|
|
5
|
+
*/
|
|
6
|
+
import { WssError } from '../../errors.js';
|
|
7
|
+
import { loadPem } from './pem.js';
|
|
8
|
+
import { loadPkcs12 } from './pkcs12.js';
|
|
9
|
+
export { loadPem } from './pem.js';
|
|
10
|
+
export { loadPkcs12 } from './pkcs12.js';
|
|
11
|
+
export { keystoreTypeForPath } from './model.js';
|
|
12
|
+
/**
|
|
13
|
+
* Parses a keystore out of its raw bytes. The engine never reads the file itself: the host
|
|
14
|
+
* checks the path and resolves the password, so containment and secret handling stay in one
|
|
15
|
+
* place (see the module docs on `model.ts`).
|
|
16
|
+
*
|
|
17
|
+
* @param bytes the keystore file's content
|
|
18
|
+
* @param options the container format and, when needed, the password
|
|
19
|
+
* @returns the parsed keystore
|
|
20
|
+
* @throws WssError `keystore-bad-password` or `keystore-invalid`
|
|
21
|
+
*/
|
|
22
|
+
export function loadKeystore(bytes, options) {
|
|
23
|
+
return options.type === 'pkcs12' ? loadPkcs12(bytes, options.password) : loadPem(bytes, options.password);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The alias a send should use: the one named, else — when nothing is named — the keystore's
|
|
27
|
+
* only usable entry.
|
|
28
|
+
*
|
|
29
|
+
* `alias` is "the explicit alias, else the registry's `defaultAlias`": the caller collapses
|
|
30
|
+
* those two before calling, because only it knows the registry entry.
|
|
31
|
+
*
|
|
32
|
+
* @param keystore the parsed keystore
|
|
33
|
+
* @param alias the requested alias, or `undefined` to fall back to the only entry
|
|
34
|
+
* @returns the selected alias
|
|
35
|
+
* @throws WssError `keystore-alias-missing` when the name is unknown, or when nothing is named
|
|
36
|
+
* and the keystore holds more (or fewer) than one usable entry
|
|
37
|
+
*/
|
|
38
|
+
export function selectAlias(keystore, alias) {
|
|
39
|
+
if (alias !== undefined && alias.length > 0) {
|
|
40
|
+
const found = keystore.aliases.find((candidate) => candidate.alias === alias);
|
|
41
|
+
if (found === undefined) {
|
|
42
|
+
throw new WssError('keystore-alias-missing', `The keystore has no alias "${alias}".`, { details: { alias } });
|
|
43
|
+
}
|
|
44
|
+
return found;
|
|
45
|
+
}
|
|
46
|
+
// "The only one" means the only one that can actually be presented: a keystore that also
|
|
47
|
+
// carries its CA has two entries but only ever one identity.
|
|
48
|
+
const withKey = keystore.aliases.filter((candidate) => candidate.hasPrivateKey);
|
|
49
|
+
const candidates = withKey.length > 0 ? withKey : keystore.aliases;
|
|
50
|
+
const only = candidates.length === 1 ? candidates[0] : undefined;
|
|
51
|
+
if (only === undefined) {
|
|
52
|
+
throw new WssError('keystore-alias-missing', candidates.length === 0
|
|
53
|
+
? 'The keystore holds no entries.'
|
|
54
|
+
: 'The keystore holds several entries; choose a default alias.', { details: { count: candidates.length } });
|
|
55
|
+
}
|
|
56
|
+
return only;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The client identity for `alias`, shaped for `TlsOptions.cert`/`key`: the leaf with its chain
|
|
60
|
+
* concatenated after it, which is what OpenSSL expects a client to present.
|
|
61
|
+
*
|
|
62
|
+
* The chain is **not** returned as `ca`: `ca` replaces Node's trust store wholesale, so offering
|
|
63
|
+
* a keystore's own issuers as trust anchors would make selecting a client identity quietly stop
|
|
64
|
+
* public certificates from verifying. Whom to trust is configured separately from who to be.
|
|
65
|
+
*
|
|
66
|
+
* @param keystore the parsed keystore
|
|
67
|
+
* @param alias the alias to present, or `undefined` for the keystore's only identity
|
|
68
|
+
* @returns the PEM material for a TLS handshake
|
|
69
|
+
* @throws WssError `keystore-alias-missing` when the alias cannot be resolved, `keystore-invalid`
|
|
70
|
+
* when the resolved alias carries no private key
|
|
71
|
+
*/
|
|
72
|
+
export function toTlsClientIdentity(keystore, alias) {
|
|
73
|
+
const entry = selectAlias(keystore, alias);
|
|
74
|
+
if (entry.keyPem === undefined) {
|
|
75
|
+
throw new WssError('keystore-invalid', `The keystore alias "${entry.alias}" has no private key.`, {
|
|
76
|
+
details: { alias: entry.alias },
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return { cert: [entry.certPem, ...entry.chainPem].join('\n'), key: entry.keyPem };
|
|
80
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shape a client keystore takes once it has been parsed: a flat list of aliases, each with
|
|
3
|
+
* its certificate (and, when the entry carries one, its private key) as PEM text.
|
|
4
|
+
*
|
|
5
|
+
* Deliberately free of any file-system access: the *host* (the desktop main process) reads the
|
|
6
|
+
* bytes after checking the path, and resolves the password out of the secret store. The engine
|
|
7
|
+
* only ever sees bytes plus an optional password, which keeps this module pure and testable and
|
|
8
|
+
* keeps every containment decision in one place.
|
|
9
|
+
*/
|
|
10
|
+
/** The container formats Wirebench can read a client identity out of. */
|
|
11
|
+
export type KeystoreType = 'pkcs12' | 'pem';
|
|
12
|
+
/** One entry of a keystore: a certificate, its chain, and — for a client identity — its key. */
|
|
13
|
+
export interface KeystoreAlias {
|
|
14
|
+
/** The entry's name: its PKCS#12 `friendlyName`, else the certificate's CN, else `key-N`. */
|
|
15
|
+
readonly alias: string;
|
|
16
|
+
/** The leaf certificate, PEM-encoded. */
|
|
17
|
+
readonly certPem: string;
|
|
18
|
+
/** The private key as an unencrypted PKCS#8 (or PKCS#1) PEM; absent for a trust-only entry. */
|
|
19
|
+
readonly keyPem?: string;
|
|
20
|
+
/** Issuers above the leaf, nearest first. Empty when the keystore carries none. */
|
|
21
|
+
readonly chainPem: readonly string[];
|
|
22
|
+
/** Distinguished name, rendered `CN=…, O=…` in the certificate's own attribute order. */
|
|
23
|
+
readonly subject: string;
|
|
24
|
+
readonly issuer: string;
|
|
25
|
+
/** ISO 8601. */
|
|
26
|
+
readonly notBefore: string;
|
|
27
|
+
readonly notAfter: string;
|
|
28
|
+
/** Serial number as upper-case hex, without a leading sign byte. */
|
|
29
|
+
readonly serial: string;
|
|
30
|
+
/** SHA-256 of the DER certificate, upper-case hex in colon-separated pairs. */
|
|
31
|
+
readonly fingerprintSha256: string;
|
|
32
|
+
readonly hasPrivateKey: boolean;
|
|
33
|
+
}
|
|
34
|
+
/** A parsed keystore. */
|
|
35
|
+
export interface Keystore {
|
|
36
|
+
readonly type: KeystoreType;
|
|
37
|
+
readonly aliases: readonly KeystoreAlias[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* One `wss/keystores.yaml` entry: where the keystore lives and how to open it. The password
|
|
41
|
+
* itself is never stored here — only a `secretRef` the host resolves through `safeStorage`.
|
|
42
|
+
*/
|
|
43
|
+
export interface KeystoreDef {
|
|
44
|
+
readonly id: string;
|
|
45
|
+
readonly name: string;
|
|
46
|
+
/** Absolute, or relative to the project root. */
|
|
47
|
+
readonly path: string;
|
|
48
|
+
readonly type: KeystoreType;
|
|
49
|
+
readonly passwordSecretRef?: string;
|
|
50
|
+
/** The name CI supplies this secret under: `WIREBENCH_SECRET_<name>`. Not a secret; committed. */
|
|
51
|
+
readonly passwordEnv?: string;
|
|
52
|
+
/** The alias a send uses when the request does not name one. */
|
|
53
|
+
readonly defaultAlias?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The client identity a TLS handshake needs, shaped for `TlsOptions`.
|
|
57
|
+
*
|
|
58
|
+
* Deliberately *only* `cert` and `key`. A keystore says who the client is; it says nothing about
|
|
59
|
+
* whom the client should trust, and Node treats `ca` as a **replacement** trust store — so
|
|
60
|
+
* handing the keystore's own chain over as `ca` would silently drop every public root and break
|
|
61
|
+
* ordinary HTTPS endpoints the moment a client identity was selected. Server trust is configured
|
|
62
|
+
* separately.
|
|
63
|
+
*/
|
|
64
|
+
export interface TlsClientIdentity {
|
|
65
|
+
/** The leaf certificate with its chain concatenated after it. */
|
|
66
|
+
readonly cert: string;
|
|
67
|
+
readonly key: string;
|
|
68
|
+
}
|
|
69
|
+
/** Options for `loadKeystore`. */
|
|
70
|
+
export interface LoadKeystoreOptions {
|
|
71
|
+
readonly type: KeystoreType;
|
|
72
|
+
/** The PKCS#12 password, or the passphrase of an encrypted PEM key. */
|
|
73
|
+
readonly password?: string;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The keystore type implied by a file's extension, or `undefined` for anything unrecognised.
|
|
77
|
+
* Used at "Add keystore" time so the registry records a concrete type rather than sniffing on
|
|
78
|
+
* every load.
|
|
79
|
+
*
|
|
80
|
+
* @param path the file name or path to classify
|
|
81
|
+
* @returns `'pkcs12'` for `.p12`/`.pfx`, `'pem'` for `.pem`/`.crt`/`.cer`/`.key`, else `undefined`
|
|
82
|
+
*/
|
|
83
|
+
export declare function keystoreTypeForPath(path: string): KeystoreType | undefined;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shape a client keystore takes once it has been parsed: a flat list of aliases, each with
|
|
3
|
+
* its certificate (and, when the entry carries one, its private key) as PEM text.
|
|
4
|
+
*
|
|
5
|
+
* Deliberately free of any file-system access: the *host* (the desktop main process) reads the
|
|
6
|
+
* bytes after checking the path, and resolves the password out of the secret store. The engine
|
|
7
|
+
* only ever sees bytes plus an optional password, which keeps this module pure and testable and
|
|
8
|
+
* keeps every containment decision in one place.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* The keystore type implied by a file's extension, or `undefined` for anything unrecognised.
|
|
12
|
+
* Used at "Add keystore" time so the registry records a concrete type rather than sniffing on
|
|
13
|
+
* every load.
|
|
14
|
+
*
|
|
15
|
+
* @param path the file name or path to classify
|
|
16
|
+
* @returns `'pkcs12'` for `.p12`/`.pfx`, `'pem'` for `.pem`/`.crt`/`.cer`/`.key`, else `undefined`
|
|
17
|
+
*/
|
|
18
|
+
export function keystoreTypeForPath(path) {
|
|
19
|
+
const lower = path.toLowerCase();
|
|
20
|
+
if (lower.endsWith('.p12') || lower.endsWith('.pfx')) {
|
|
21
|
+
return 'pkcs12';
|
|
22
|
+
}
|
|
23
|
+
if (lower.endsWith('.pem') || lower.endsWith('.crt') || lower.endsWith('.key') || lower.endsWith('.cer')) {
|
|
24
|
+
return 'pem';
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PEM bundle reading: one or more `CERTIFICATE` blocks plus at most one private-key block, in
|
|
3
|
+
* any order — the shape `cat client.crt client.key ca.crt > client.pem` produces.
|
|
4
|
+
*
|
|
5
|
+
* Unencrypted key blocks are passed through **verbatim** rather than re-encoded: Node's `tls`
|
|
6
|
+
* accepts PKCS#1, PKCS#8 and SEC1 (EC) keys as they stand, and re-encoding them through forge
|
|
7
|
+
* would silently drop the key types forge cannot model. Only an encrypted block is decrypted,
|
|
8
|
+
* because a passphrase-protected key is exactly what the keystore password is for.
|
|
9
|
+
*/
|
|
10
|
+
import type { Keystore } from './model.js';
|
|
11
|
+
/**
|
|
12
|
+
* Reads a PEM bundle.
|
|
13
|
+
*
|
|
14
|
+
* @param bytes the raw bundle content (UTF-8 text)
|
|
15
|
+
* @param password the passphrase of an encrypted key block, if there is one
|
|
16
|
+
* @returns a keystore with exactly one alias: the leaf, with every other certificate as chain
|
|
17
|
+
* @throws WssError `keystore-invalid` when the bytes hold no certificate or the key block is
|
|
18
|
+
* encrypted with an unsupported (non-RSA) algorithm, `keystore-bad-password` when an encrypted
|
|
19
|
+
* key block cannot be decrypted with `password`
|
|
20
|
+
*/
|
|
21
|
+
export declare function loadPem(bytes: Uint8Array, password?: string): Keystore;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PEM bundle reading: one or more `CERTIFICATE` blocks plus at most one private-key block, in
|
|
3
|
+
* any order — the shape `cat client.crt client.key ca.crt > client.pem` produces.
|
|
4
|
+
*
|
|
5
|
+
* Unencrypted key blocks are passed through **verbatim** rather than re-encoded: Node's `tls`
|
|
6
|
+
* accepts PKCS#1, PKCS#8 and SEC1 (EC) keys as they stand, and re-encoding them through forge
|
|
7
|
+
* would silently drop the key types forge cannot model. Only an encrypted block is decrypted,
|
|
8
|
+
* because a passphrase-protected key is exactly what the keystore password is for.
|
|
9
|
+
*/
|
|
10
|
+
import forge from 'node-forge';
|
|
11
|
+
import { WssError } from '../../errors.js';
|
|
12
|
+
import { buildChain, commonNameOf, describeCertificate, keyPemMatchesCertificate } from './certificate.js';
|
|
13
|
+
/** The block types this reader treats as a private key. */
|
|
14
|
+
const KEY_TYPES = new Set(['PRIVATE KEY', 'RSA PRIVATE KEY', 'EC PRIVATE KEY', 'ENCRYPTED PRIVATE KEY']);
|
|
15
|
+
function invalid(message, cause) {
|
|
16
|
+
return new WssError('keystore-invalid', message, cause === undefined ? undefined : { cause });
|
|
17
|
+
}
|
|
18
|
+
function badPassword(cause) {
|
|
19
|
+
return new WssError('keystore-bad-password', 'The keystore password is incorrect or missing.', {
|
|
20
|
+
...(cause === undefined ? {} : { cause }),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
/** Re-renders one decoded message back to PEM text, so each block can be handled on its own. */
|
|
24
|
+
function toPem(message) {
|
|
25
|
+
return forge.pem.encode(message);
|
|
26
|
+
}
|
|
27
|
+
/** True when the block cannot be used without a passphrase. */
|
|
28
|
+
function isEncrypted(message) {
|
|
29
|
+
return message.type === 'ENCRYPTED PRIVATE KEY' || (message.procType?.type ?? '') === 'ENCRYPTED';
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* An encrypted key block whose algorithm this reader cannot open. Reported as `keystore-invalid`
|
|
33
|
+
* rather than `keystore-bad-password` so the user is not sent round the "retype the password"
|
|
34
|
+
* loop for a key that no password will ever unlock here.
|
|
35
|
+
*/
|
|
36
|
+
function unsupportedEncryptedKey(type, cause) {
|
|
37
|
+
return new WssError('keystore-invalid', `Encrypted "${type}" blocks are not supported: only encrypted RSA keys can be opened. ` +
|
|
38
|
+
'Convert the key to an unencrypted PEM, or use a PKCS#12 keystore.', { details: { blockType: type }, ...(cause === undefined ? {} : { cause }) });
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A decrypted PKCS#8 `ENCRYPTED PRIVATE KEY` block, as unencrypted PKCS#8 PEM.
|
|
42
|
+
*
|
|
43
|
+
* The two failure modes are told apart deliberately: the decryption itself failing is a wrong
|
|
44
|
+
* password, while decrypting cleanly and then not parsing as RSA is an unsupported key type.
|
|
45
|
+
*/
|
|
46
|
+
function decryptPkcs8(pem, password) {
|
|
47
|
+
let info;
|
|
48
|
+
try {
|
|
49
|
+
info = forge.pki.decryptPrivateKeyInfo(forge.pki.encryptedPrivateKeyFromPem(pem), password);
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
throw badPassword(error);
|
|
53
|
+
}
|
|
54
|
+
if (info === null) {
|
|
55
|
+
throw badPassword();
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
forge.pki.privateKeyFromAsn1(info);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
throw unsupportedEncryptedKey('ENCRYPTED PRIVATE KEY', error);
|
|
62
|
+
}
|
|
63
|
+
return forge.pki.privateKeyInfoToPem(info);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* The usable key PEM for `message`: the block verbatim when it is not encrypted, the decrypted
|
|
67
|
+
* PKCS#8 rendering when it is.
|
|
68
|
+
*/
|
|
69
|
+
function keyPemOf(message, password) {
|
|
70
|
+
const pem = toPem(message);
|
|
71
|
+
if (!isEncrypted(message)) {
|
|
72
|
+
return pem;
|
|
73
|
+
}
|
|
74
|
+
if (password === undefined || password.length === 0) {
|
|
75
|
+
throw badPassword();
|
|
76
|
+
}
|
|
77
|
+
if (message.type === 'ENCRYPTED PRIVATE KEY') {
|
|
78
|
+
return decryptPkcs8(pem, password);
|
|
79
|
+
}
|
|
80
|
+
// A legacy `Proc-Type: 4,ENCRYPTED` block names its key type in the header, so an EC or DSA
|
|
81
|
+
// one can be refused before a passphrase is even tried.
|
|
82
|
+
if (message.type !== 'RSA PRIVATE KEY') {
|
|
83
|
+
throw unsupportedEncryptedKey(message.type);
|
|
84
|
+
}
|
|
85
|
+
let key;
|
|
86
|
+
try {
|
|
87
|
+
key = forge.pki.decryptRsaPrivateKey(pem, password);
|
|
88
|
+
}
|
|
89
|
+
catch (error) {
|
|
90
|
+
throw badPassword(error);
|
|
91
|
+
}
|
|
92
|
+
if (key === null) {
|
|
93
|
+
throw badPassword();
|
|
94
|
+
}
|
|
95
|
+
return forge.pki.privateKeyInfoToPem(forge.pki.wrapRsaPrivateKey(forge.pki.privateKeyToAsn1(key)));
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Reads a PEM bundle.
|
|
99
|
+
*
|
|
100
|
+
* @param bytes the raw bundle content (UTF-8 text)
|
|
101
|
+
* @param password the passphrase of an encrypted key block, if there is one
|
|
102
|
+
* @returns a keystore with exactly one alias: the leaf, with every other certificate as chain
|
|
103
|
+
* @throws WssError `keystore-invalid` when the bytes hold no certificate or the key block is
|
|
104
|
+
* encrypted with an unsupported (non-RSA) algorithm, `keystore-bad-password` when an encrypted
|
|
105
|
+
* key block cannot be decrypted with `password`
|
|
106
|
+
*/
|
|
107
|
+
export function loadPem(bytes, password) {
|
|
108
|
+
const text = Buffer.from(bytes).toString('utf8');
|
|
109
|
+
let messages;
|
|
110
|
+
try {
|
|
111
|
+
messages = forge.pem.decode(text);
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
throw invalid('The file is not a readable PEM bundle.', error);
|
|
115
|
+
}
|
|
116
|
+
const certificates = messages
|
|
117
|
+
.filter((message) => message.type === 'CERTIFICATE')
|
|
118
|
+
.map((message) => forge.pki.certificateFromPem(toPem(message)));
|
|
119
|
+
if (certificates.length === 0) {
|
|
120
|
+
throw invalid('The PEM bundle holds no certificate.');
|
|
121
|
+
}
|
|
122
|
+
const keyMessage = messages.find((message) => KEY_TYPES.has(message.type));
|
|
123
|
+
const keyPem = keyMessage === undefined ? undefined : keyPemOf(keyMessage, password);
|
|
124
|
+
const leaf = (keyPem === undefined ? undefined : certificates.find((cert) => keyPemMatchesCertificate(keyPem, cert))) ??
|
|
125
|
+
certificates[0];
|
|
126
|
+
/* c8 ignore next 3 -- `certificates` is non-empty above, so `leaf` is always defined. */
|
|
127
|
+
if (leaf === undefined) {
|
|
128
|
+
throw invalid('The PEM bundle holds no certificate.');
|
|
129
|
+
}
|
|
130
|
+
const used = new Set([leaf]);
|
|
131
|
+
const chain = buildChain(leaf, certificates, used);
|
|
132
|
+
const alias = {
|
|
133
|
+
alias: commonNameOf(leaf) ?? 'key-0',
|
|
134
|
+
...describeCertificate(leaf),
|
|
135
|
+
...(keyPem === undefined ? {} : { keyPem }),
|
|
136
|
+
chainPem: chain.map((cert) => forge.pki.certificateToPem(cert)),
|
|
137
|
+
hasPrivateKey: keyPem !== undefined,
|
|
138
|
+
};
|
|
139
|
+
return { type: 'pem', aliases: [alias] };
|
|
140
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PKCS#12 (`.p12`/`.pfx`) reading, via node-forge.
|
|
3
|
+
*
|
|
4
|
+
* A PKCS#12 file is a bag of bags: shrouded key bags, certificate bags, and attributes
|
|
5
|
+
* (`friendlyName`, `localKeyId`) that tie a key to its certificate. This module flattens that
|
|
6
|
+
* into the alias list the rest of Wirebench works with, re-exporting every private key as an
|
|
7
|
+
* unencrypted PKCS#8 PEM **in memory only** — nothing here writes to disk, and the caller is
|
|
8
|
+
* expected to keep the result out of the renderer.
|
|
9
|
+
*/
|
|
10
|
+
import type { Keystore } from './model.js';
|
|
11
|
+
/**
|
|
12
|
+
* Reads a PKCS#12 keystore.
|
|
13
|
+
*
|
|
14
|
+
* @param bytes the raw `.p12`/`.pfx` content
|
|
15
|
+
* @param password the keystore password; an empty/absent password is tried as `''`
|
|
16
|
+
* @returns the parsed keystore, one alias per key entry plus one per unused certificate
|
|
17
|
+
* @throws WssError `keystore-bad-password` when the MAC does not verify, `keystore-invalid`
|
|
18
|
+
* when the bytes are not a PKCS#12 file at all, or when a key it holds matches none of its
|
|
19
|
+
* certificates
|
|
20
|
+
*/
|
|
21
|
+
export declare function loadPkcs12(bytes: Uint8Array, password?: string): Keystore;
|