@runlith/tagma 0.0.0-stage → 0.1.0
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/adapter/claudeHooks.d.ts +10 -0
- package/adapter/claudeHooks.js +4 -0
- package/adapter/declaration.d.ts +14 -0
- package/adapter/declaration.js +2 -0
- package/adapter/harness.d.ts +454 -0
- package/adapter/harness.js +2 -0
- package/adapter/hook.d.ts +43 -0
- package/adapter/hook.js +2 -0
- package/adapter/hostModules.d.ts +19 -0
- package/adapter/hostModules.js +2 -0
- package/adapter/loader.d.ts +10 -0
- package/adapter/loader.js +2 -0
- package/adapter/metadata.d.ts +179 -0
- package/adapter/metadata.js +4 -0
- package/adapter/payload.d.ts +19 -0
- package/adapter/payload.js +3 -0
- package/adapter/provider.d.ts +209 -0
- package/adapter/provider.js +2 -0
- package/adapter/settings.d.ts +182 -0
- package/adapter/settings.js +2 -0
- package/adapter/speech.d.ts +4 -0
- package/adapter/speech.js +2 -0
- package/host.d.ts +61223 -0
- package/package.json +129 -3
- package/plugin/Held-6krt6ncs.js +6 -0
- package/plugin/accountKey-tdjj67f5.js +2 -0
- package/plugin/adapter-qdnpxs6n.js +1 -0
- package/plugin/anthropic-a4pdzrv2.js +2 -0
- package/plugin/anthropic-messages-7gtja121.js +2 -0
- package/plugin/anthropic-z9xqmm3q.js +2 -0
- package/plugin/auth-0w6kk39v.js +2 -0
- package/plugin/authStatus-a1g3eb9p.js +2 -0
- package/plugin/bundling.d.ts +30 -0
- package/plugin/bundling.js +2 -0
- package/plugin/cacheLifetime-c5mpw676.js +2 -0
- package/plugin/callback-server-0wrzmjfx.js +16 -0
- package/plugin/capabilities-n3vfpy41.js +2 -0
- package/plugin/claudeHooks-edpg1e46.js +3 -0
- package/plugin/cli.js +21 -0
- package/plugin/cliStore-9rhjxtht.js +2 -0
- package/plugin/clientSession-tmmxm39z.js +2 -0
- package/plugin/codec-aa8mxqyr.js +1 -0
- package/plugin/connect-vrdsw05j.js +2 -0
- package/plugin/contract-qn0z7r9c.js +1 -0
- package/plugin/credential-5sgapkh0.js +2 -0
- package/plugin/deepseek-fvdrmjr9.js +2 -0
- package/plugin/deepseek-v388d1wv.js +2 -0
- package/plugin/definition-s3xx207f.js +2 -0
- package/plugin/description-8xhxryaq.js +2 -0
- package/plugin/deviceGrant-vgbscpr4.js +2 -0
- package/plugin/devin-hy98d305.js +2 -0
- package/plugin/duplex-kpmftvf7.js +2 -0
- package/plugin/endpoint-kvf97tz7.js +2 -0
- package/plugin/errors-5t42p4q1.js +2 -0
- package/plugin/events-e8vv9hda.js +2 -0
- package/plugin/events-s95ybm4g.js +2 -0
- package/plugin/executor-q8kp5q8h.js +2 -0
- package/plugin/failure-vr32debc.js +2 -0
- package/plugin/framing-nktw5sts.js +2 -0
- package/plugin/grant-67b10nhx.js +2 -0
- package/plugin/harness-nrh78w4d.js +2 -0
- package/plugin/headers-ss3dzznj.js +2 -0
- package/plugin/hook-hjrk83m8.js +2 -0
- package/plugin/icon-044pa3y8.js +6 -0
- package/plugin/icon-j22svmgp.js +4 -0
- package/plugin/icon-ny6qbjvc.js +4 -0
- package/plugin/icon-pz54e8n3.js +4 -0
- package/plugin/icon-qy92jx2b.js +4 -0
- package/plugin/ids-n269hc5k.js +2 -0
- package/plugin/images-q80x3bt1.js +2 -0
- package/plugin/index-cyd7v366.js +2 -0
- package/plugin/index-jpmjpmkn.js +2 -0
- package/plugin/lifecycle-qf4fh5m8.js +2 -0
- package/plugin/manual-2mdscj84.js +2 -0
- package/plugin/messages-1szh3p3k.js +2 -0
- package/plugin/metadata-zm1v3ptf.js +4 -0
- package/plugin/muse-r16jp51z.js +2 -0
- package/plugin/muse-tfe6sph7.js +2 -0
- package/plugin/museToolSchema-tbe0f3wa.js +2 -0
- package/plugin/notes-6amdhm6h.js +2 -0
- package/plugin/object-9pjtdam7.js +2 -0
- package/plugin/open-browser-vqb7ckt1.js +2 -0
- package/plugin/openai-0z6fy497.js +2 -0
- package/plugin/openai-37dne8v0.js +2 -0
- package/plugin/openai-compatible-chat-tq9w69h4.js +2 -0
- package/plugin/openai-images-x1sj79qh.js +2 -0
- package/plugin/openai-responses-dka6k753.js +2 -0
- package/plugin/opencodeGo-173fz5c5.js +3 -0
- package/plugin/opencodeGo-qgw3pfg6.js +2 -0
- package/plugin/options-pxwjpfdk.js +2 -0
- package/plugin/payload-2gr4q9g8.js +2 -0
- package/plugin/pkce-nrpept7w.js +2 -0
- package/plugin/plugin-1n46me5n.js +6 -0
- package/plugin/plugin-1vpp5mqk.js +4 -0
- package/plugin/plugin-1x94cj6e.js +3 -0
- package/plugin/plugin-1xze8f5y.js +3 -0
- package/plugin/plugin-285exjxd.js +3 -0
- package/plugin/plugin-3b8x73y6.js +3 -0
- package/plugin/plugin-3pfrkxg1.js +3 -0
- package/plugin/plugin-3whwpedj.js +3 -0
- package/plugin/plugin-521srf94.js +3 -0
- package/plugin/plugin-55fbx586.js +3 -0
- package/plugin/plugin-5zq084fb.js +3 -0
- package/plugin/plugin-60bdzk1r.js +4 -0
- package/plugin/plugin-6a56xsx3.js +3 -0
- package/plugin/plugin-6xpcmvm3.js +36 -0
- package/plugin/plugin-72xxqm1t.js +3 -0
- package/plugin/plugin-7y7ndrk9.js +3 -0
- package/plugin/plugin-80gqwmjy.js +3 -0
- package/plugin/plugin-8230g28p.js +3 -0
- package/plugin/plugin-8jf7f360.js +3 -0
- package/plugin/plugin-92redty0.js +3 -0
- package/plugin/plugin-9gha9fx3.js +3 -0
- package/plugin/plugin-a4ng6krf.js +3 -0
- package/plugin/plugin-ak62rhwz.js +3 -0
- package/plugin/plugin-ay29ch70.js +3 -0
- package/plugin/plugin-ba1sv0th.js +3 -0
- package/plugin/plugin-ca4vf4j5.js +3 -0
- package/plugin/plugin-cydz2zhy.js +3 -0
- package/plugin/plugin-d6hbav22.js +3 -0
- package/plugin/plugin-e2y95zm5.js +3 -0
- package/plugin/plugin-ff38dxy1.js +3 -0
- package/plugin/plugin-ff9hx5a4.js +3 -0
- package/plugin/plugin-fhc5q7r3.js +3 -0
- package/plugin/plugin-frrvs5yc.js +3 -0
- package/plugin/plugin-g65b14k1.js +3 -0
- package/plugin/plugin-gh857xdd.js +3 -0
- package/plugin/plugin-gkgs7vfv.js +3 -0
- package/plugin/plugin-h66k1zhn.js +14 -0
- package/plugin/plugin-je5cfnqn.js +3 -0
- package/plugin/plugin-jjm52353.js +3 -0
- package/plugin/plugin-jxvmq18y.js +3 -0
- package/plugin/plugin-kc4z9msd.js +3 -0
- package/plugin/plugin-kjtzm2q6.js +3 -0
- package/plugin/plugin-krbbb4ts.js +3 -0
- package/plugin/plugin-me00x60n.js +3 -0
- package/plugin/plugin-mqr325kz.js +3 -0
- package/plugin/plugin-njh1f7b2.js +5 -0
- package/plugin/plugin-nkb5bb2q.js +3 -0
- package/plugin/plugin-nqmb78ez.js +4 -0
- package/plugin/plugin-nzacjxf9.js +3 -0
- package/plugin/plugin-p59gy5xd.js +3 -0
- package/plugin/plugin-pfj9nc2e.js +3 -0
- package/plugin/plugin-pkxw1pfs.js +3 -0
- package/plugin/plugin-q1n5kwx0.js +3 -0
- package/plugin/plugin-q1sqj2tc.js +3 -0
- package/plugin/plugin-q7rk75bs.js +3 -0
- package/plugin/plugin-qpda63gv.js +3 -0
- package/plugin/plugin-rrgyjesv.js +3 -0
- package/plugin/plugin-sfdxgkds.js +3 -0
- package/plugin/plugin-v7k9fx92.js +3 -0
- package/plugin/plugin-vfjhxng8.js +3 -0
- package/plugin/plugin-vv72e4ah.js +3 -0
- package/plugin/plugin-w8f977my.js +3 -0
- package/plugin/plugin-xbnw80pk.js +3 -0
- package/plugin/plugin-yxgg03s0.js +5 -0
- package/plugin/plugin-z6hkd9rw.js +3 -0
- package/plugin/plugin-zew2m18x.js +3 -0
- package/plugin/plugin-zphe2a5v.js +9 -0
- package/plugin/plugin-zvyk8bnr.js +3 -0
- package/plugin/plugin-zw3ywa4b.js +3 -0
- package/plugin/plugin-zxe49p72.js +3 -0
- package/plugin/plugin-zz7yc97m.js +3 -0
- package/plugin/plugin.d.ts +175 -0
- package/plugin/plugin.js +2 -0
- package/plugin/points.generated.d.ts +341 -0
- package/plugin/points.generated.js +2 -0
- package/plugin/process.d.ts +4 -0
- package/plugin/process.js +85 -0
- package/plugin/protocol-hwnfh4h1.js +2 -0
- package/plugin/protocol.d.ts +115 -0
- package/plugin/protocol.js +2 -0
- package/plugin/provider-0b7xxyhn.js +2 -0
- package/plugin/quota-vrrmfag6.js +2 -0
- package/plugin/quotaRead-vj6e90xc.js +2 -0
- package/plugin/reasoning-5nanktp2.js +2 -0
- package/plugin/record-1m3vvy60.js +2 -0
- package/plugin/requests-2zyr1g8e.js +1 -0
- package/plugin/responseFold-w4526gvb.js +2 -0
- package/plugin/settings-vdypzert.js +2 -0
- package/plugin/shared-a2yyy8ry.js +2 -0
- package/plugin/speech-067caz1a.js +2 -0
- package/plugin/stepfun-3en5g41d.js +2 -0
- package/plugin/stepfun-bwsz4nrd.js +2 -0
- package/plugin/stream-bt8etfpc.js +2 -0
- package/plugin/svelteProgram-73v9yajk.js +2 -0
- package/plugin/synthesisDuplex-m2j6pmyv.js +2 -0
- package/plugin/template.d.ts +14 -0
- package/plugin/template.js +2 -0
- package/plugin/testing.d.ts +85 -0
- package/plugin/testing.js +4 -0
- package/plugin/tool-content-b9jtprr7.js +2 -0
- package/plugin/tool-stream-gdajdxn0.js +2 -0
- package/plugin/transport-7hfp9sn4.js +2 -0
- package/plugin/ui.generated.d.ts +1044 -0
- package/plugin/value.d.ts +8 -0
- package/plugin/value.js +2 -0
- package/plugin/vendor-pn6b5a8f.js +2 -0
- package/plugin/vendorCall-6n5chrn0.js +2 -0
- package/plugin/vendorCall-hv01nwsp.js +2 -0
- package/plugin/vendorPayload-awxqr7t8.js +2 -0
- package/plugin/vendorWeb-vnf344r1.js +2 -0
- package/plugin/verbatim-mqt9x4aa.js +2 -0
- package/plugin/xai-e8sbtk6a.js +2 -0
- package/plugin/xai-z1ysta23.js +2 -0
- package/rules/effect.d.ts +55 -0
- package/rules/effect.js +11 -0
- package/rules/rules.d.ts +342 -0
- package/rules/rules.js +50 -0
- package/types/node/assert/strict.d.ts +12 -0
- package/types/node/assert.d.ts +76 -0
- package/types/node/async_hooks.d.ts +113 -0
- package/types/node/buffer.buffer.d.ts +29 -0
- package/types/node/buffer.d.ts +162 -0
- package/types/node/child_process.d.ts +337 -0
- package/types/node/cluster.d.ts +118 -0
- package/types/node/compatibility/iterators.d.ts +11 -0
- package/types/node/console.d.ts +48 -0
- package/types/node/constants.d.ts +8 -0
- package/types/node/crypto.d.ts +847 -0
- package/types/node/dgram.d.ts +88 -0
- package/types/node/diagnostics_channel.d.ts +61 -0
- package/types/node/dns/promises.d.ts +94 -0
- package/types/node/dns.d.ts +276 -0
- package/types/node/domain.d.ts +17 -0
- package/types/node/events.d.ts +138 -0
- package/types/node/fs/promises.d.ts +253 -0
- package/types/node/fs.d.ts +1038 -0
- package/types/node/globals.d.ts +73 -0
- package/types/node/globals.typedarray.d.ts +22 -0
- package/types/node/http.d.ts +530 -0
- package/types/node/http2.d.ts +794 -0
- package/types/node/https.d.ts +66 -0
- package/types/node/index.d.ts +84 -0
- package/types/node/inspector/promises.d.ts +13 -0
- package/types/node/inspector.d.ts +61 -0
- package/types/node/inspector.generated.d.ts +1624 -0
- package/types/node/module.d.ts +187 -0
- package/types/node/net.d.ts +266 -0
- package/types/node/os.d.ts +236 -0
- package/types/node/path/posix.d.ts +8 -0
- package/types/node/path/win32.d.ts +8 -0
- package/types/node/path.d.ts +40 -0
- package/types/node/perf_hooks.d.ts +236 -0
- package/types/node/process.d.ts +436 -0
- package/types/node/punycode.d.ts +15 -0
- package/types/node/querystring.d.ts +22 -0
- package/types/node/quic.d.ts +203 -0
- package/types/node/readline/promises.d.ts +28 -0
- package/types/node/readline.d.ts +94 -0
- package/types/node/repl.d.ts +104 -0
- package/types/node/sea.d.ts +11 -0
- package/types/node/sqlite.d.ts +183 -0
- package/types/node/stream/consumers.d.ts +13 -0
- package/types/node/stream/iter.d.ts +240 -0
- package/types/node/stream/promises.d.ts +37 -0
- package/types/node/stream/web.d.ts +297 -0
- package/types/node/stream.d.ts +378 -0
- package/types/node/string_decoder.d.ts +10 -0
- package/types/node/test/reporters.d.ts +66 -0
- package/types/node/test.d.ts +462 -0
- package/types/node/timers/promises.d.ts +16 -0
- package/types/node/timers.d.ts +43 -0
- package/types/node/tls.d.ts +279 -0
- package/types/node/trace_events.d.ts +16 -0
- package/types/node/ts5.6/buffer.buffer.d.ts +26 -0
- package/types/node/ts5.6/compatibility/float16array.d.ts +43 -0
- package/types/node/ts5.6/globals.typedarray.d.ts +22 -0
- package/types/node/ts5.6/index.d.ts +84 -0
- package/types/node/ts5.7/compatibility/float16array.d.ts +50 -0
- package/types/node/ts5.7/index.d.ts +84 -0
- package/types/node/tty.d.ts +61 -0
- package/types/node/url.d.ts +165 -0
- package/types/node/util/types.d.ts +49 -0
- package/types/node/util.d.ts +320 -0
- package/types/node/v8.d.ts +178 -0
- package/types/node/vm.d.ts +130 -0
- package/types/node/wasi.d.ts +26 -0
- package/types/node/web-globals/abortcontroller.d.ts +47 -0
- package/types/node/web-globals/blob.d.ts +34 -0
- package/types/node/web-globals/console.d.ts +7 -0
- package/types/node/web-globals/crypto.d.ts +46 -0
- package/types/node/web-globals/domexception.d.ts +74 -0
- package/types/node/web-globals/encoding.d.ts +16 -0
- package/types/node/web-globals/events.d.ts +111 -0
- package/types/node/web-globals/fetch.d.ts +121 -0
- package/types/node/web-globals/importmeta.d.ts +11 -0
- package/types/node/web-globals/messaging.d.ts +32 -0
- package/types/node/web-globals/navigator.d.ts +28 -0
- package/types/node/web-globals/performance.d.ts +71 -0
- package/types/node/web-globals/storage.d.ts +26 -0
- package/types/node/web-globals/streams.d.ts +162 -0
- package/types/node/web-globals/timers.d.ts +22 -0
- package/types/node/web-globals/url.d.ts +27 -0
- package/types/node/worker_threads.d.ts +199 -0
- package/types/node/zlib/iter.d.ts +49 -0
- package/types/node/zlib.d.ts +360 -0
- package/types/undici/agent.d.ts +24 -0
- package/types/undici/api.d.ts +19 -0
- package/types/undici/balanced-pool.d.ts +16 -0
- package/types/undici/cache-interceptor.d.ts +98 -0
- package/types/undici/cache.d.ts +30 -0
- package/types/undici/client-stats.d.ts +9 -0
- package/types/undici/client.d.ts +61 -0
- package/types/undici/connector.d.ts +37 -0
- package/types/undici/content-type.d.ts +9 -0
- package/types/undici/cookies.d.ts +22 -0
- package/types/undici/diagnostics-channel.d.ts +72 -0
- package/types/undici/dispatcher.d.ts +207 -0
- package/types/undici/env-http-proxy-agent.d.ts +15 -0
- package/types/undici/errors.d.ts +117 -0
- package/types/undici/eventsource.d.ts +39 -0
- package/types/undici/fetch.d.ts +122 -0
- package/types/undici/formdata.d.ts +24 -0
- package/types/undici/global-dispatcher.d.ts +4 -0
- package/types/undici/global-origin.d.ts +3 -0
- package/types/undici/h2c-client.d.ts +35 -0
- package/types/undici/handlers.d.ts +7 -0
- package/types/undici/header.d.ts +10 -0
- package/types/undici/index.d.ts +85 -0
- package/types/undici/interceptors.d.ts +70 -0
- package/types/undici/mock-agent.d.ts +43 -0
- package/types/undici/mock-call-history.d.ts +57 -0
- package/types/undici/mock-client.d.ts +17 -0
- package/types/undici/mock-errors.d.ts +9 -0
- package/types/undici/mock-interceptor.d.ts +60 -0
- package/types/undici/mock-pool.d.ts +17 -0
- package/types/undici/patch.d.ts +21 -0
- package/types/undici/pool-stats.d.ts +11 -0
- package/types/undici/pool.d.ts +25 -0
- package/types/undici/proxy-agent.d.ts +22 -0
- package/types/undici/readable.d.ts +24 -0
- package/types/undici/retry-agent.d.ts +6 -0
- package/types/undici/retry-handler.d.ts +41 -0
- package/types/undici/round-robin-pool.d.ts +25 -0
- package/types/undici/snapshot-agent.d.ts +98 -0
- package/types/undici/socks5-proxy-agent.d.ts +17 -0
- package/types/undici/util.d.ts +4 -0
- package/types/undici/utility.d.ts +2 -0
- package/types/undici/webidl.d.ts +121 -0
- package/types/undici/websocket.d.ts +130 -0
- package/README.md +0 -3
|
@@ -0,0 +1,847 @@
|
|
|
1
|
+
declare module "node:crypto" {
|
|
2
|
+
import { NonSharedBuffer } from "node:buffer";
|
|
3
|
+
import * as stream from "node:stream";
|
|
4
|
+
import { PeerCertificate } from "node:tls";
|
|
5
|
+
class Certificate {
|
|
6
|
+
static exportChallenge(spkac: BinaryLike): NonSharedBuffer;
|
|
7
|
+
static exportPublicKey(spkac: BinaryLike, encoding?: string): NonSharedBuffer;
|
|
8
|
+
static verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
|
|
9
|
+
exportChallenge(spkac: BinaryLike): NonSharedBuffer;
|
|
10
|
+
exportPublicKey(spkac: BinaryLike, encoding?: string): NonSharedBuffer;
|
|
11
|
+
verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
|
|
12
|
+
}
|
|
13
|
+
namespace constants {
|
|
14
|
+
const OPENSSL_VERSION_NUMBER: number;
|
|
15
|
+
const SSL_OP_ALL: number;
|
|
16
|
+
const SSL_OP_ALLOW_NO_DHE_KEX: number;
|
|
17
|
+
const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
|
|
18
|
+
const SSL_OP_CIPHER_SERVER_PREFERENCE: number;
|
|
19
|
+
const SSL_OP_CISCO_ANYCONNECT: number;
|
|
20
|
+
const SSL_OP_COOKIE_EXCHANGE: number;
|
|
21
|
+
const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number;
|
|
22
|
+
const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number;
|
|
23
|
+
const SSL_OP_LEGACY_SERVER_CONNECT: number;
|
|
24
|
+
const SSL_OP_NO_COMPRESSION: number;
|
|
25
|
+
const SSL_OP_NO_ENCRYPT_THEN_MAC: number;
|
|
26
|
+
const SSL_OP_NO_QUERY_MTU: number;
|
|
27
|
+
const SSL_OP_NO_RENEGOTIATION: number;
|
|
28
|
+
const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number;
|
|
29
|
+
const SSL_OP_NO_SSLv2: number;
|
|
30
|
+
const SSL_OP_NO_SSLv3: number;
|
|
31
|
+
const SSL_OP_NO_TICKET: number;
|
|
32
|
+
const SSL_OP_NO_TLSv1: number;
|
|
33
|
+
const SSL_OP_NO_TLSv1_1: number;
|
|
34
|
+
const SSL_OP_NO_TLSv1_2: number;
|
|
35
|
+
const SSL_OP_NO_TLSv1_3: number;
|
|
36
|
+
const SSL_OP_PRIORITIZE_CHACHA: number;
|
|
37
|
+
const SSL_OP_TLS_ROLLBACK_BUG: number;
|
|
38
|
+
const ENGINE_METHOD_RSA: number;
|
|
39
|
+
const ENGINE_METHOD_DSA: number;
|
|
40
|
+
const ENGINE_METHOD_DH: number;
|
|
41
|
+
const ENGINE_METHOD_RAND: number;
|
|
42
|
+
const ENGINE_METHOD_EC: number;
|
|
43
|
+
const ENGINE_METHOD_CIPHERS: number;
|
|
44
|
+
const ENGINE_METHOD_DIGESTS: number;
|
|
45
|
+
const ENGINE_METHOD_PKEY_METHS: number;
|
|
46
|
+
const ENGINE_METHOD_PKEY_ASN1_METHS: number;
|
|
47
|
+
const ENGINE_METHOD_ALL: number;
|
|
48
|
+
const ENGINE_METHOD_NONE: number;
|
|
49
|
+
const DH_CHECK_P_NOT_SAFE_PRIME: number;
|
|
50
|
+
const DH_CHECK_P_NOT_PRIME: number;
|
|
51
|
+
const DH_UNABLE_TO_CHECK_GENERATOR: number;
|
|
52
|
+
const DH_NOT_SUITABLE_GENERATOR: number;
|
|
53
|
+
const RSA_PKCS1_PADDING: number;
|
|
54
|
+
const RSA_SSLV23_PADDING: number;
|
|
55
|
+
const RSA_NO_PADDING: number;
|
|
56
|
+
const RSA_PKCS1_OAEP_PADDING: number;
|
|
57
|
+
const RSA_X931_PADDING: number;
|
|
58
|
+
const RSA_PKCS1_PSS_PADDING: number;
|
|
59
|
+
const RSA_PSS_SALTLEN_DIGEST: number;
|
|
60
|
+
const RSA_PSS_SALTLEN_MAX_SIGN: number;
|
|
61
|
+
const RSA_PSS_SALTLEN_AUTO: number;
|
|
62
|
+
const POINT_CONVERSION_COMPRESSED: number;
|
|
63
|
+
const POINT_CONVERSION_UNCOMPRESSED: number;
|
|
64
|
+
const POINT_CONVERSION_HYBRID: number;
|
|
65
|
+
const defaultCoreCipherList: string;
|
|
66
|
+
const defaultCipherList: string;
|
|
67
|
+
}
|
|
68
|
+
interface HashOptions extends stream.TransformOptions {
|
|
69
|
+
outputLength?: number | undefined;
|
|
70
|
+
}
|
|
71
|
+
const fips: boolean;
|
|
72
|
+
function createHash(algorithm: string, options?: HashOptions): Hash;
|
|
73
|
+
function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac;
|
|
74
|
+
type BinaryToTextEncoding = "base64" | "base64url" | "hex" | "binary";
|
|
75
|
+
type CharacterEncoding = "utf8" | "utf-8" | "utf16le" | "utf-16le" | "latin1";
|
|
76
|
+
type LegacyCharacterEncoding = "ascii" | "binary" | "ucs2" | "ucs-2";
|
|
77
|
+
type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding;
|
|
78
|
+
type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
|
|
79
|
+
class Hash extends stream.Transform {
|
|
80
|
+
private constructor();
|
|
81
|
+
copy(options?: HashOptions): Hash;
|
|
82
|
+
update(data: BinaryLike): Hash;
|
|
83
|
+
update(data: string, inputEncoding: Encoding): Hash;
|
|
84
|
+
digest(): NonSharedBuffer;
|
|
85
|
+
digest(encoding: BinaryToTextEncoding): string;
|
|
86
|
+
}
|
|
87
|
+
class Hmac extends stream.Transform {
|
|
88
|
+
private constructor();
|
|
89
|
+
update(data: BinaryLike): Hmac;
|
|
90
|
+
update(data: string, inputEncoding: Encoding): Hmac;
|
|
91
|
+
digest(): NonSharedBuffer;
|
|
92
|
+
digest(encoding: BinaryToTextEncoding): string;
|
|
93
|
+
}
|
|
94
|
+
type KeyFormat = "pem" | "der" | "jwk";
|
|
95
|
+
type KeyObjectType = "secret" | "public" | "private";
|
|
96
|
+
type PublicKeyExportType = "pkcs1" | "spki";
|
|
97
|
+
type PrivateKeyExportType = "pkcs1" | "pkcs8" | "sec1";
|
|
98
|
+
type KeyExportOptions = SymmetricKeyExportOptions | PublicKeyExportOptions | PrivateKeyExportOptions | JwkKeyExportOptions;
|
|
99
|
+
interface SymmetricKeyExportOptions {
|
|
100
|
+
format?: "buffer" | undefined;
|
|
101
|
+
}
|
|
102
|
+
interface PublicKeyExportOptions<T extends PublicKeyExportType = PublicKeyExportType> {
|
|
103
|
+
type: T;
|
|
104
|
+
format: Exclude<KeyFormat, "jwk">;
|
|
105
|
+
}
|
|
106
|
+
interface PrivateKeyExportOptions<T extends PrivateKeyExportType = PrivateKeyExportType> {
|
|
107
|
+
type: T;
|
|
108
|
+
format: Exclude<KeyFormat, "jwk">;
|
|
109
|
+
cipher?: string | undefined;
|
|
110
|
+
passphrase?: string | Buffer | undefined;
|
|
111
|
+
}
|
|
112
|
+
interface JwkKeyExportOptions {
|
|
113
|
+
format: "jwk";
|
|
114
|
+
}
|
|
115
|
+
interface KeyPairExportOptions<TPublic extends PublicKeyExportType = PublicKeyExportType, TPrivate extends PrivateKeyExportType = PrivateKeyExportType> {
|
|
116
|
+
publicKeyEncoding?: PublicKeyExportOptions<TPublic> | JwkKeyExportOptions | undefined;
|
|
117
|
+
privateKeyEncoding?: PrivateKeyExportOptions<TPrivate> | JwkKeyExportOptions | undefined;
|
|
118
|
+
}
|
|
119
|
+
type KeyExportResult<T, Default> = T extends {
|
|
120
|
+
format: infer F extends KeyFormat;
|
|
121
|
+
} ? {
|
|
122
|
+
der: NonSharedBuffer;
|
|
123
|
+
jwk: webcrypto.JsonWebKey;
|
|
124
|
+
pem: string;
|
|
125
|
+
}[F] : Default;
|
|
126
|
+
interface KeyPairExportResult<T extends KeyPairExportOptions> {
|
|
127
|
+
publicKey: KeyExportResult<T["publicKeyEncoding"], KeyObject>;
|
|
128
|
+
privateKey: KeyExportResult<T["privateKeyEncoding"], KeyObject>;
|
|
129
|
+
}
|
|
130
|
+
type KeyPairExportCallback<T extends KeyPairExportOptions> = (err: Error | null, publicKey: KeyExportResult<T["publicKeyEncoding"], KeyObject>, privateKey: KeyExportResult<T["privateKeyEncoding"], KeyObject>) => void;
|
|
131
|
+
type MLDSAKeyType = `ml-dsa-${44 | 65 | 87}`;
|
|
132
|
+
type MLKEMKeyType = `ml-kem-${1024 | 512 | 768}`;
|
|
133
|
+
type SLHDSAKeyType = `slh-dsa-${"sha2" | "shake"}-${128 | 192 | 256}${"f" | "s"}`;
|
|
134
|
+
type AsymmetricKeyType = "dh" | "dsa" | "ec" | "ed25519" | "ed448" | MLDSAKeyType | MLKEMKeyType | "rsa-pss" | "rsa" | SLHDSAKeyType | "x25519" | "x448";
|
|
135
|
+
interface AsymmetricKeyDetails {
|
|
136
|
+
modulusLength?: number;
|
|
137
|
+
publicExponent?: bigint;
|
|
138
|
+
hashAlgorithm?: string;
|
|
139
|
+
mgf1HashAlgorithm?: string;
|
|
140
|
+
saltLength?: number;
|
|
141
|
+
divisorLength?: number;
|
|
142
|
+
namedCurve?: string;
|
|
143
|
+
}
|
|
144
|
+
class KeyObject {
|
|
145
|
+
private constructor();
|
|
146
|
+
static from(key: webcrypto.CryptoKey): KeyObject;
|
|
147
|
+
asymmetricKeyType?: AsymmetricKeyType;
|
|
148
|
+
asymmetricKeyDetails?: AsymmetricKeyDetails;
|
|
149
|
+
export<T extends KeyExportOptions = {}>(options?: T): KeyExportResult<T, NonSharedBuffer>;
|
|
150
|
+
equals(otherKeyObject: KeyObject): boolean;
|
|
151
|
+
symmetricKeySize?: number;
|
|
152
|
+
toCryptoKey(algorithm: webcrypto.AlgorithmIdentifier | webcrypto.RsaHashedImportParams | webcrypto.EcKeyImportParams | webcrypto.HmacImportParams, extractable: boolean, keyUsages: readonly webcrypto.KeyUsage[]): webcrypto.CryptoKey;
|
|
153
|
+
type: KeyObjectType;
|
|
154
|
+
}
|
|
155
|
+
type CipherCCMTypes = "aes-128-ccm" | "aes-192-ccm" | "aes-256-ccm";
|
|
156
|
+
type CipherGCMTypes = "aes-128-gcm" | "aes-192-gcm" | "aes-256-gcm";
|
|
157
|
+
type CipherOCBTypes = "aes-128-ocb" | "aes-192-ocb" | "aes-256-ocb";
|
|
158
|
+
type CipherChaCha20Poly1305Types = "chacha20-poly1305";
|
|
159
|
+
type BinaryLike = string | NodeJS.ArrayBufferView;
|
|
160
|
+
type CipherKey = BinaryLike | KeyObject;
|
|
161
|
+
interface CipherCCMOptions extends stream.TransformOptions {
|
|
162
|
+
authTagLength: number;
|
|
163
|
+
}
|
|
164
|
+
interface CipherGCMOptions extends stream.TransformOptions {
|
|
165
|
+
authTagLength?: number | undefined;
|
|
166
|
+
}
|
|
167
|
+
interface CipherOCBOptions extends stream.TransformOptions {
|
|
168
|
+
authTagLength: number;
|
|
169
|
+
}
|
|
170
|
+
interface CipherChaCha20Poly1305Options extends stream.TransformOptions {
|
|
171
|
+
authTagLength?: number | undefined;
|
|
172
|
+
}
|
|
173
|
+
function createCipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike, options: CipherCCMOptions): CipherCCM;
|
|
174
|
+
function createCipheriv(algorithm: CipherOCBTypes, key: CipherKey, iv: BinaryLike, options: CipherOCBOptions): CipherOCB;
|
|
175
|
+
function createCipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike, options?: CipherGCMOptions): CipherGCM;
|
|
176
|
+
function createCipheriv(algorithm: CipherChaCha20Poly1305Types, key: CipherKey, iv: BinaryLike, options?: CipherChaCha20Poly1305Options): CipherChaCha20Poly1305;
|
|
177
|
+
function createCipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Cipheriv;
|
|
178
|
+
class Cipheriv extends stream.Transform {
|
|
179
|
+
private constructor();
|
|
180
|
+
update(data: BinaryLike): NonSharedBuffer;
|
|
181
|
+
update(data: string, inputEncoding: Encoding): NonSharedBuffer;
|
|
182
|
+
update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
|
|
183
|
+
update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
|
|
184
|
+
final(): NonSharedBuffer;
|
|
185
|
+
final(outputEncoding: BufferEncoding): string;
|
|
186
|
+
setAutoPadding(autoPadding?: boolean): this;
|
|
187
|
+
}
|
|
188
|
+
interface CipherCCM extends Cipheriv {
|
|
189
|
+
setAAD(buffer: NodeJS.ArrayBufferView, options: {
|
|
190
|
+
plaintextLength: number;
|
|
191
|
+
}): this;
|
|
192
|
+
getAuthTag(): NonSharedBuffer;
|
|
193
|
+
}
|
|
194
|
+
interface CipherGCM extends Cipheriv {
|
|
195
|
+
setAAD(buffer: NodeJS.ArrayBufferView, options?: {
|
|
196
|
+
plaintextLength: number;
|
|
197
|
+
}): this;
|
|
198
|
+
getAuthTag(): NonSharedBuffer;
|
|
199
|
+
}
|
|
200
|
+
interface CipherOCB extends Cipheriv {
|
|
201
|
+
setAAD(buffer: NodeJS.ArrayBufferView, options?: {
|
|
202
|
+
plaintextLength: number;
|
|
203
|
+
}): this;
|
|
204
|
+
getAuthTag(): NonSharedBuffer;
|
|
205
|
+
}
|
|
206
|
+
interface CipherChaCha20Poly1305 extends Cipheriv {
|
|
207
|
+
setAAD(buffer: NodeJS.ArrayBufferView, options: {
|
|
208
|
+
plaintextLength: number;
|
|
209
|
+
}): this;
|
|
210
|
+
getAuthTag(): NonSharedBuffer;
|
|
211
|
+
}
|
|
212
|
+
function createDecipheriv(algorithm: CipherCCMTypes, key: CipherKey, iv: BinaryLike, options: CipherCCMOptions): DecipherCCM;
|
|
213
|
+
function createDecipheriv(algorithm: CipherOCBTypes, key: CipherKey, iv: BinaryLike, options: CipherOCBOptions): DecipherOCB;
|
|
214
|
+
function createDecipheriv(algorithm: CipherGCMTypes, key: CipherKey, iv: BinaryLike, options?: CipherGCMOptions): DecipherGCM;
|
|
215
|
+
function createDecipheriv(algorithm: CipherChaCha20Poly1305Types, key: CipherKey, iv: BinaryLike, options?: CipherChaCha20Poly1305Options): DecipherChaCha20Poly1305;
|
|
216
|
+
function createDecipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Decipheriv;
|
|
217
|
+
class Decipheriv extends stream.Transform {
|
|
218
|
+
private constructor();
|
|
219
|
+
update(data: NodeJS.ArrayBufferView): NonSharedBuffer;
|
|
220
|
+
update(data: string, inputEncoding: Encoding): NonSharedBuffer;
|
|
221
|
+
update(data: NodeJS.ArrayBufferView, inputEncoding: undefined, outputEncoding: Encoding): string;
|
|
222
|
+
update(data: string, inputEncoding: Encoding | undefined, outputEncoding: Encoding): string;
|
|
223
|
+
final(): NonSharedBuffer;
|
|
224
|
+
final(outputEncoding: BufferEncoding): string;
|
|
225
|
+
setAutoPadding(auto_padding?: boolean): this;
|
|
226
|
+
}
|
|
227
|
+
interface DecipherCCM extends Decipheriv {
|
|
228
|
+
setAuthTag(buffer: NodeJS.ArrayBufferView): this;
|
|
229
|
+
setAAD(buffer: NodeJS.ArrayBufferView, options: {
|
|
230
|
+
plaintextLength: number;
|
|
231
|
+
}): this;
|
|
232
|
+
}
|
|
233
|
+
interface DecipherGCM extends Decipheriv {
|
|
234
|
+
setAuthTag(buffer: NodeJS.ArrayBufferView): this;
|
|
235
|
+
setAAD(buffer: NodeJS.ArrayBufferView, options?: {
|
|
236
|
+
plaintextLength: number;
|
|
237
|
+
}): this;
|
|
238
|
+
}
|
|
239
|
+
interface DecipherOCB extends Decipheriv {
|
|
240
|
+
setAuthTag(buffer: NodeJS.ArrayBufferView): this;
|
|
241
|
+
setAAD(buffer: NodeJS.ArrayBufferView, options?: {
|
|
242
|
+
plaintextLength: number;
|
|
243
|
+
}): this;
|
|
244
|
+
}
|
|
245
|
+
interface DecipherChaCha20Poly1305 extends Decipheriv {
|
|
246
|
+
setAuthTag(buffer: NodeJS.ArrayBufferView): this;
|
|
247
|
+
setAAD(buffer: NodeJS.ArrayBufferView, options: {
|
|
248
|
+
plaintextLength: number;
|
|
249
|
+
}): this;
|
|
250
|
+
}
|
|
251
|
+
interface PrivateKeyInput {
|
|
252
|
+
key: string | Buffer;
|
|
253
|
+
format?: KeyFormat | undefined;
|
|
254
|
+
type?: PrivateKeyExportType | undefined;
|
|
255
|
+
passphrase?: string | Buffer | undefined;
|
|
256
|
+
encoding?: string | undefined;
|
|
257
|
+
}
|
|
258
|
+
interface PublicKeyInput {
|
|
259
|
+
key: string | Buffer;
|
|
260
|
+
format?: KeyFormat | undefined;
|
|
261
|
+
type?: PublicKeyExportType | undefined;
|
|
262
|
+
encoding?: string | undefined;
|
|
263
|
+
}
|
|
264
|
+
function generateKey(type: "hmac" | "aes", options: {
|
|
265
|
+
length: number;
|
|
266
|
+
}, callback: (err: Error | null, key: KeyObject) => void): void;
|
|
267
|
+
function generateKeySync(type: "hmac" | "aes", options: {
|
|
268
|
+
length: number;
|
|
269
|
+
}): KeyObject;
|
|
270
|
+
interface JsonWebKeyInput {
|
|
271
|
+
key: webcrypto.JsonWebKey;
|
|
272
|
+
format: "jwk";
|
|
273
|
+
}
|
|
274
|
+
function createPrivateKey(key: PrivateKeyInput | string | Buffer | JsonWebKeyInput): KeyObject;
|
|
275
|
+
function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject | JsonWebKeyInput): KeyObject;
|
|
276
|
+
function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject;
|
|
277
|
+
function createSecretKey(key: string, encoding: BufferEncoding): KeyObject;
|
|
278
|
+
function createSign(algorithm: string, options?: stream.WritableOptions): Sign;
|
|
279
|
+
type DSAEncoding = "der" | "ieee-p1363";
|
|
280
|
+
interface SigningOptions {
|
|
281
|
+
padding?: number | undefined;
|
|
282
|
+
saltLength?: number | undefined;
|
|
283
|
+
dsaEncoding?: DSAEncoding | undefined;
|
|
284
|
+
context?: ArrayBuffer | NodeJS.ArrayBufferView | undefined;
|
|
285
|
+
}
|
|
286
|
+
interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {
|
|
287
|
+
}
|
|
288
|
+
interface SignKeyObjectInput extends SigningOptions {
|
|
289
|
+
key: KeyObject;
|
|
290
|
+
}
|
|
291
|
+
interface SignJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {
|
|
292
|
+
}
|
|
293
|
+
interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {
|
|
294
|
+
}
|
|
295
|
+
interface VerifyKeyObjectInput extends SigningOptions {
|
|
296
|
+
key: KeyObject;
|
|
297
|
+
}
|
|
298
|
+
interface VerifyJsonWebKeyInput extends JsonWebKeyInput, SigningOptions {
|
|
299
|
+
}
|
|
300
|
+
type KeyLike = string | Buffer | KeyObject;
|
|
301
|
+
class Sign extends stream.Writable {
|
|
302
|
+
private constructor();
|
|
303
|
+
update(data: BinaryLike): this;
|
|
304
|
+
update(data: string, inputEncoding: Encoding): this;
|
|
305
|
+
sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput): NonSharedBuffer;
|
|
306
|
+
sign(privateKey: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput, outputFormat: BinaryToTextEncoding): string;
|
|
307
|
+
}
|
|
308
|
+
function createVerify(algorithm: string, options?: stream.WritableOptions): Verify;
|
|
309
|
+
class Verify extends stream.Writable {
|
|
310
|
+
private constructor();
|
|
311
|
+
update(data: BinaryLike): Verify;
|
|
312
|
+
update(data: string, inputEncoding: Encoding): Verify;
|
|
313
|
+
verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, signature: NodeJS.ArrayBufferView): boolean;
|
|
314
|
+
verify(object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, signature: string, signature_format?: BinaryToTextEncoding): boolean;
|
|
315
|
+
}
|
|
316
|
+
function createDiffieHellman(primeLength: number, generator?: number): DiffieHellman;
|
|
317
|
+
function createDiffieHellman(prime: ArrayBuffer | NodeJS.ArrayBufferView, generator?: number | ArrayBuffer | NodeJS.ArrayBufferView): DiffieHellman;
|
|
318
|
+
function createDiffieHellman(prime: ArrayBuffer | NodeJS.ArrayBufferView, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman;
|
|
319
|
+
function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator?: number | ArrayBuffer | NodeJS.ArrayBufferView): DiffieHellman;
|
|
320
|
+
function createDiffieHellman(prime: string, primeEncoding: BinaryToTextEncoding, generator: string, generatorEncoding: BinaryToTextEncoding): DiffieHellman;
|
|
321
|
+
class DiffieHellman {
|
|
322
|
+
private constructor();
|
|
323
|
+
generateKeys(): NonSharedBuffer;
|
|
324
|
+
generateKeys(encoding: BinaryToTextEncoding): string;
|
|
325
|
+
computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding?: null, outputEncoding?: null): NonSharedBuffer;
|
|
326
|
+
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding?: null): NonSharedBuffer;
|
|
327
|
+
computeSecret(otherPublicKey: NodeJS.ArrayBufferView, inputEncoding: null, outputEncoding: BinaryToTextEncoding): string;
|
|
328
|
+
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string;
|
|
329
|
+
getPrime(): NonSharedBuffer;
|
|
330
|
+
getPrime(encoding: BinaryToTextEncoding): string;
|
|
331
|
+
getGenerator(): NonSharedBuffer;
|
|
332
|
+
getGenerator(encoding: BinaryToTextEncoding): string;
|
|
333
|
+
getPublicKey(): NonSharedBuffer;
|
|
334
|
+
getPublicKey(encoding: BinaryToTextEncoding): string;
|
|
335
|
+
getPrivateKey(): NonSharedBuffer;
|
|
336
|
+
getPrivateKey(encoding: BinaryToTextEncoding): string;
|
|
337
|
+
setPublicKey(publicKey: NodeJS.ArrayBufferView): void;
|
|
338
|
+
setPublicKey(publicKey: string, encoding: BufferEncoding): void;
|
|
339
|
+
setPrivateKey(privateKey: NodeJS.ArrayBufferView): void;
|
|
340
|
+
setPrivateKey(privateKey: string, encoding: BufferEncoding): void;
|
|
341
|
+
verifyError: number;
|
|
342
|
+
}
|
|
343
|
+
const DiffieHellmanGroup: DiffieHellmanGroupConstructor;
|
|
344
|
+
interface DiffieHellmanGroupConstructor {
|
|
345
|
+
new (name: string): DiffieHellmanGroup;
|
|
346
|
+
(name: string): DiffieHellmanGroup;
|
|
347
|
+
readonly prototype: DiffieHellmanGroup;
|
|
348
|
+
}
|
|
349
|
+
type DiffieHellmanGroup = Omit<DiffieHellman, "setPublicKey" | "setPrivateKey">;
|
|
350
|
+
function getDiffieHellman(groupName: string): DiffieHellmanGroup;
|
|
351
|
+
function createDiffieHellmanGroup(name: string): DiffieHellmanGroup;
|
|
352
|
+
function pbkdf2(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string, callback: (err: Error | null, derivedKey: NonSharedBuffer) => void): void;
|
|
353
|
+
function pbkdf2Sync(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string): NonSharedBuffer;
|
|
354
|
+
function randomBytes(size: number): NonSharedBuffer;
|
|
355
|
+
function randomBytes(size: number, callback: (err: Error | null, buf: NonSharedBuffer) => void): void;
|
|
356
|
+
function pseudoRandomBytes(size: number): NonSharedBuffer;
|
|
357
|
+
function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: NonSharedBuffer) => void): void;
|
|
358
|
+
function randomInt(max: number): number;
|
|
359
|
+
function randomInt(min: number, max: number): number;
|
|
360
|
+
function randomInt(max: number, callback: (err: Error | null, value: number) => void): void;
|
|
361
|
+
function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void;
|
|
362
|
+
function randomFillSync<T extends NodeJS.ArrayBufferView>(buffer: T, offset?: number, size?: number): T;
|
|
363
|
+
function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, callback: (err: Error | null, buf: T) => void): void;
|
|
364
|
+
function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void;
|
|
365
|
+
function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void;
|
|
366
|
+
interface ScryptOptions {
|
|
367
|
+
cost?: number | undefined;
|
|
368
|
+
blockSize?: number | undefined;
|
|
369
|
+
parallelization?: number | undefined;
|
|
370
|
+
N?: number | undefined;
|
|
371
|
+
r?: number | undefined;
|
|
372
|
+
p?: number | undefined;
|
|
373
|
+
maxmem?: number | undefined;
|
|
374
|
+
}
|
|
375
|
+
function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: NonSharedBuffer) => void): void;
|
|
376
|
+
function scrypt(password: BinaryLike, salt: BinaryLike, keylen: number, options: ScryptOptions, callback: (err: Error | null, derivedKey: NonSharedBuffer) => void): void;
|
|
377
|
+
function scryptSync(password: BinaryLike, salt: BinaryLike, keylen: number, options?: ScryptOptions): NonSharedBuffer;
|
|
378
|
+
interface RsaPublicKey {
|
|
379
|
+
key: KeyLike;
|
|
380
|
+
padding?: number | undefined;
|
|
381
|
+
}
|
|
382
|
+
interface RsaPrivateKey {
|
|
383
|
+
key: KeyLike;
|
|
384
|
+
passphrase?: string | undefined;
|
|
385
|
+
oaepHash?: string | undefined;
|
|
386
|
+
oaepLabel?: NodeJS.TypedArray | undefined;
|
|
387
|
+
padding?: number | undefined;
|
|
388
|
+
}
|
|
389
|
+
function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView | string): NonSharedBuffer;
|
|
390
|
+
function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView | string): NonSharedBuffer;
|
|
391
|
+
function privateDecrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView | string): NonSharedBuffer;
|
|
392
|
+
function privateEncrypt(privateKey: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView | string): NonSharedBuffer;
|
|
393
|
+
function getCiphers(): string[];
|
|
394
|
+
function getCurves(): string[];
|
|
395
|
+
function getFips(): 1 | 0;
|
|
396
|
+
function setFips(bool: boolean): void;
|
|
397
|
+
function getHashes(): string[];
|
|
398
|
+
class ECDH {
|
|
399
|
+
private constructor();
|
|
400
|
+
static convertKey(key: BinaryLike, curve: string, inputEncoding?: BinaryToTextEncoding, outputEncoding?: "latin1" | "hex" | "base64" | "base64url", format?: "uncompressed" | "compressed" | "hybrid"): NonSharedBuffer | string;
|
|
401
|
+
generateKeys(): NonSharedBuffer;
|
|
402
|
+
generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
|
|
403
|
+
computeSecret(otherPublicKey: NodeJS.ArrayBufferView): NonSharedBuffer;
|
|
404
|
+
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding): NonSharedBuffer;
|
|
405
|
+
computeSecret(otherPublicKey: NodeJS.ArrayBufferView, outputEncoding: BinaryToTextEncoding): string;
|
|
406
|
+
computeSecret(otherPublicKey: string, inputEncoding: BinaryToTextEncoding, outputEncoding: BinaryToTextEncoding): string;
|
|
407
|
+
getPrivateKey(): NonSharedBuffer;
|
|
408
|
+
getPrivateKey(encoding: BinaryToTextEncoding): string;
|
|
409
|
+
getPublicKey(encoding?: null, format?: ECDHKeyFormat): NonSharedBuffer;
|
|
410
|
+
getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
|
|
411
|
+
setPrivateKey(privateKey: NodeJS.ArrayBufferView): void;
|
|
412
|
+
setPrivateKey(privateKey: string, encoding: BinaryToTextEncoding): void;
|
|
413
|
+
}
|
|
414
|
+
function createECDH(curveName: string): ECDH;
|
|
415
|
+
function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean;
|
|
416
|
+
interface DHKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {
|
|
417
|
+
prime?: Buffer | undefined;
|
|
418
|
+
primeLength?: number | undefined;
|
|
419
|
+
generator?: number | undefined;
|
|
420
|
+
groupName?: string | undefined;
|
|
421
|
+
}
|
|
422
|
+
interface DSAKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {
|
|
423
|
+
modulusLength: number;
|
|
424
|
+
divisorLength: number;
|
|
425
|
+
}
|
|
426
|
+
interface ECKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8" | "sec1"> {
|
|
427
|
+
namedCurve: string;
|
|
428
|
+
paramEncoding?: "explicit" | "named" | undefined;
|
|
429
|
+
}
|
|
430
|
+
interface ED25519KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {
|
|
431
|
+
}
|
|
432
|
+
interface ED448KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {
|
|
433
|
+
}
|
|
434
|
+
interface MLDSAKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {
|
|
435
|
+
}
|
|
436
|
+
interface MLKEMKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {
|
|
437
|
+
}
|
|
438
|
+
interface RSAPSSKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {
|
|
439
|
+
modulusLength: number;
|
|
440
|
+
publicExponent?: number | undefined;
|
|
441
|
+
hashAlgorithm?: string | undefined;
|
|
442
|
+
mgf1HashAlgorithm?: string | undefined;
|
|
443
|
+
saltLength?: string | undefined;
|
|
444
|
+
}
|
|
445
|
+
interface RSAKeyPairOptions extends KeyPairExportOptions<"pkcs1" | "spki", "pkcs1" | "pkcs8"> {
|
|
446
|
+
modulusLength: number;
|
|
447
|
+
publicExponent?: number | undefined;
|
|
448
|
+
}
|
|
449
|
+
interface SLHDSAKeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {
|
|
450
|
+
}
|
|
451
|
+
interface X25519KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {
|
|
452
|
+
}
|
|
453
|
+
interface X448KeyPairOptions extends KeyPairExportOptions<"spki", "pkcs8"> {
|
|
454
|
+
}
|
|
455
|
+
function generateKeyPairSync<T extends DHKeyPairOptions>(type: "dh", options: T): KeyPairExportResult<T>;
|
|
456
|
+
function generateKeyPairSync<T extends DSAKeyPairOptions>(type: "dsa", options: T): KeyPairExportResult<T>;
|
|
457
|
+
function generateKeyPairSync<T extends ECKeyPairOptions>(type: "ec", options: T): KeyPairExportResult<T>;
|
|
458
|
+
function generateKeyPairSync<T extends ED25519KeyPairOptions = {}>(type: "ed25519", options?: T): KeyPairExportResult<T>;
|
|
459
|
+
function generateKeyPairSync<T extends ED448KeyPairOptions = {}>(type: "ed448", options?: T): KeyPairExportResult<T>;
|
|
460
|
+
function generateKeyPairSync<T extends MLDSAKeyPairOptions = {}>(type: MLDSAKeyType, options?: T): KeyPairExportResult<T>;
|
|
461
|
+
function generateKeyPairSync<T extends MLKEMKeyPairOptions = {}>(type: MLKEMKeyType, options?: T): KeyPairExportResult<T>;
|
|
462
|
+
function generateKeyPairSync<T extends RSAPSSKeyPairOptions>(type: "rsa-pss", options: T): KeyPairExportResult<T>;
|
|
463
|
+
function generateKeyPairSync<T extends RSAKeyPairOptions>(type: "rsa", options: T): KeyPairExportResult<T>;
|
|
464
|
+
function generateKeyPairSync<T extends SLHDSAKeyPairOptions = {}>(type: SLHDSAKeyType, options?: T): KeyPairExportResult<T>;
|
|
465
|
+
function generateKeyPairSync<T extends X25519KeyPairOptions = {}>(type: "x25519", options?: T): KeyPairExportResult<T>;
|
|
466
|
+
function generateKeyPairSync<T extends X448KeyPairOptions = {}>(type: "x448", options?: T): KeyPairExportResult<T>;
|
|
467
|
+
function generateKeyPair<T extends DHKeyPairOptions>(type: "dh", options: T, callback: KeyPairExportCallback<T>): void;
|
|
468
|
+
function generateKeyPair<T extends DSAKeyPairOptions>(type: "dsa", options: T, callback: KeyPairExportCallback<T>): void;
|
|
469
|
+
function generateKeyPair<T extends ECKeyPairOptions>(type: "ec", options: T, callback: KeyPairExportCallback<T>): void;
|
|
470
|
+
function generateKeyPair<T extends ED25519KeyPairOptions = {}>(type: "ed25519", options: T | undefined, callback: KeyPairExportCallback<T>): void;
|
|
471
|
+
function generateKeyPair<T extends ED448KeyPairOptions = {}>(type: "ed448", options: T | undefined, callback: KeyPairExportCallback<T>): void;
|
|
472
|
+
function generateKeyPair<T extends MLDSAKeyPairOptions = {}>(type: MLDSAKeyType, options: T | undefined, callback: KeyPairExportCallback<T>): void;
|
|
473
|
+
function generateKeyPair<T extends MLKEMKeyPairOptions = {}>(type: MLKEMKeyType, options: T | undefined, callback: KeyPairExportCallback<T>): void;
|
|
474
|
+
function generateKeyPair<T extends RSAPSSKeyPairOptions>(type: "rsa-pss", options: T, callback: KeyPairExportCallback<T>): void;
|
|
475
|
+
function generateKeyPair<T extends RSAKeyPairOptions>(type: "rsa", options: T, callback: KeyPairExportCallback<T>): void;
|
|
476
|
+
function generateKeyPair<T extends SLHDSAKeyPairOptions = {}>(type: SLHDSAKeyType, options: T | undefined, callback: KeyPairExportCallback<T>): void;
|
|
477
|
+
function generateKeyPair<T extends X25519KeyPairOptions = {}>(type: "x25519", options: T | undefined, callback: KeyPairExportCallback<T>): void;
|
|
478
|
+
function generateKeyPair<T extends X448KeyPairOptions = {}>(type: "x448", options: T | undefined, callback: KeyPairExportCallback<T>): void;
|
|
479
|
+
namespace generateKeyPair {
|
|
480
|
+
function __promisify__<T extends DHKeyPairOptions>(type: "dh", options: T): Promise<KeyPairExportResult<T>>;
|
|
481
|
+
function __promisify__<T extends DSAKeyPairOptions>(type: "dsa", options: T): Promise<KeyPairExportResult<T>>;
|
|
482
|
+
function __promisify__<T extends ECKeyPairOptions>(type: "ec", options: T): Promise<KeyPairExportResult<T>>;
|
|
483
|
+
function __promisify__<T extends ED25519KeyPairOptions = {}>(type: "ed25519", options?: T): Promise<KeyPairExportResult<T>>;
|
|
484
|
+
function __promisify__<T extends ED448KeyPairOptions = {}>(type: "ed448", options?: T): Promise<KeyPairExportResult<T>>;
|
|
485
|
+
function __promisify__<T extends MLDSAKeyPairOptions = {}>(type: MLDSAKeyType, options?: T): Promise<KeyPairExportResult<T>>;
|
|
486
|
+
function __promisify__<T extends MLKEMKeyPairOptions = {}>(type: MLKEMKeyType, options?: T): Promise<KeyPairExportResult<T>>;
|
|
487
|
+
function __promisify__<T extends RSAPSSKeyPairOptions>(type: "rsa-pss", options: T): Promise<KeyPairExportResult<T>>;
|
|
488
|
+
function __promisify__<T extends RSAKeyPairOptions>(type: "rsa", options: T): Promise<KeyPairExportResult<T>>;
|
|
489
|
+
function __promisify__<T extends SLHDSAKeyPairOptions = {}>(type: SLHDSAKeyType, options?: T): Promise<KeyPairExportResult<T>>;
|
|
490
|
+
function __promisify__<T extends X25519KeyPairOptions = {}>(type: "x25519", options?: T): Promise<KeyPairExportResult<T>>;
|
|
491
|
+
function __promisify__<T extends X448KeyPairOptions = {}>(type: "x448", options?: T): Promise<KeyPairExportResult<T>>;
|
|
492
|
+
}
|
|
493
|
+
function sign(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput): NonSharedBuffer;
|
|
494
|
+
function sign(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput, callback: (error: Error | null, data: NonSharedBuffer) => void): void;
|
|
495
|
+
function verify(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, signature: NodeJS.ArrayBufferView): boolean;
|
|
496
|
+
function verify(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput | VerifyJsonWebKeyInput, signature: NodeJS.ArrayBufferView, callback: (error: Error | null, result: boolean) => void): void;
|
|
497
|
+
function decapsulate(key: KeyLike | PrivateKeyInput | JsonWebKeyInput, ciphertext: ArrayBuffer | NodeJS.ArrayBufferView): NonSharedBuffer;
|
|
498
|
+
function decapsulate(key: KeyLike | PrivateKeyInput | JsonWebKeyInput, ciphertext: ArrayBuffer | NodeJS.ArrayBufferView, callback: (err: Error, sharedKey: NonSharedBuffer) => void): void;
|
|
499
|
+
function diffieHellman(options: {
|
|
500
|
+
privateKey: KeyObject;
|
|
501
|
+
publicKey: KeyObject;
|
|
502
|
+
}): NonSharedBuffer;
|
|
503
|
+
function diffieHellman(options: {
|
|
504
|
+
privateKey: KeyObject;
|
|
505
|
+
publicKey: KeyObject;
|
|
506
|
+
}, callback: (err: Error | null, secret: NonSharedBuffer) => void): void;
|
|
507
|
+
function encapsulate(key: KeyLike | PublicKeyInput | JsonWebKeyInput): {
|
|
508
|
+
sharedKey: NonSharedBuffer;
|
|
509
|
+
ciphertext: NonSharedBuffer;
|
|
510
|
+
};
|
|
511
|
+
function encapsulate(key: KeyLike | PublicKeyInput | JsonWebKeyInput, callback: (err: Error, result: {
|
|
512
|
+
sharedKey: NonSharedBuffer;
|
|
513
|
+
ciphertext: NonSharedBuffer;
|
|
514
|
+
}) => void): void;
|
|
515
|
+
interface OneShotDigestOptions {
|
|
516
|
+
outputEncoding?: BinaryToTextEncoding | "buffer" | undefined;
|
|
517
|
+
outputLength?: number | undefined;
|
|
518
|
+
}
|
|
519
|
+
interface OneShotDigestOptionsWithStringEncoding extends OneShotDigestOptions {
|
|
520
|
+
outputEncoding?: BinaryToTextEncoding | undefined;
|
|
521
|
+
}
|
|
522
|
+
interface OneShotDigestOptionsWithBufferEncoding extends OneShotDigestOptions {
|
|
523
|
+
outputEncoding: "buffer";
|
|
524
|
+
}
|
|
525
|
+
function hash(algorithm: string, data: BinaryLike, options?: OneShotDigestOptionsWithStringEncoding | BinaryToTextEncoding): string;
|
|
526
|
+
function hash(algorithm: string, data: BinaryLike, options: OneShotDigestOptionsWithBufferEncoding | "buffer"): NonSharedBuffer;
|
|
527
|
+
function hash(algorithm: string, data: BinaryLike, options: OneShotDigestOptions | BinaryToTextEncoding | "buffer"): string | NonSharedBuffer;
|
|
528
|
+
type CipherMode = "cbc" | "ccm" | "cfb" | "ctr" | "ecb" | "gcm" | "ocb" | "ofb" | "stream" | "wrap" | "xts";
|
|
529
|
+
interface CipherInfoOptions {
|
|
530
|
+
keyLength?: number | undefined;
|
|
531
|
+
ivLength?: number | undefined;
|
|
532
|
+
}
|
|
533
|
+
interface CipherInfo {
|
|
534
|
+
name: string;
|
|
535
|
+
nid: number;
|
|
536
|
+
blockSize?: number | undefined;
|
|
537
|
+
ivLength?: number | undefined;
|
|
538
|
+
keyLength: number;
|
|
539
|
+
mode: CipherMode;
|
|
540
|
+
}
|
|
541
|
+
function getCipherInfo(nameOrNid: string | number, options?: CipherInfoOptions): CipherInfo | undefined;
|
|
542
|
+
function hkdf(digest: string, irm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number, callback: (err: Error | null, derivedKey: ArrayBuffer) => void): void;
|
|
543
|
+
function hkdfSync(digest: string, ikm: BinaryLike | KeyObject, salt: BinaryLike, info: BinaryLike, keylen: number): ArrayBuffer;
|
|
544
|
+
interface SecureHeapUsage {
|
|
545
|
+
total: number;
|
|
546
|
+
min: number;
|
|
547
|
+
used: number;
|
|
548
|
+
utilization: number;
|
|
549
|
+
}
|
|
550
|
+
function secureHeapUsed(): SecureHeapUsage;
|
|
551
|
+
interface RandomUUIDOptions {
|
|
552
|
+
disableEntropyCache?: boolean | undefined;
|
|
553
|
+
}
|
|
554
|
+
type UUID = `${string}-${string}-${string}-${string}-${string}`;
|
|
555
|
+
function randomUUID(options?: RandomUUIDOptions): UUID;
|
|
556
|
+
interface X509CheckOptions {
|
|
557
|
+
subject?: "always" | "default" | "never" | undefined;
|
|
558
|
+
wildcards?: boolean | undefined;
|
|
559
|
+
partialWildcards?: boolean | undefined;
|
|
560
|
+
multiLabelWildcards?: boolean | undefined;
|
|
561
|
+
singleLabelSubdomains?: boolean | undefined;
|
|
562
|
+
}
|
|
563
|
+
class X509Certificate {
|
|
564
|
+
readonly ca: boolean;
|
|
565
|
+
readonly fingerprint: string;
|
|
566
|
+
readonly fingerprint256: string;
|
|
567
|
+
readonly fingerprint512: string;
|
|
568
|
+
readonly subject: string;
|
|
569
|
+
readonly subjectAltName: string | undefined;
|
|
570
|
+
readonly infoAccess: string | undefined;
|
|
571
|
+
readonly keyUsage: string[];
|
|
572
|
+
readonly issuer: string;
|
|
573
|
+
readonly issuerCertificate: X509Certificate | undefined;
|
|
574
|
+
readonly publicKey: KeyObject;
|
|
575
|
+
readonly raw: NonSharedBuffer;
|
|
576
|
+
readonly serialNumber: string;
|
|
577
|
+
readonly signatureAlgorithm: string | undefined;
|
|
578
|
+
readonly signatureAlgorithmOid: string;
|
|
579
|
+
readonly validFrom: string;
|
|
580
|
+
readonly validFromDate: Date;
|
|
581
|
+
readonly validTo: string;
|
|
582
|
+
readonly validToDate: Date;
|
|
583
|
+
constructor(buffer: BinaryLike);
|
|
584
|
+
checkEmail(email: string, options?: Pick<X509CheckOptions, "subject">): string | undefined;
|
|
585
|
+
checkHost(name: string, options?: X509CheckOptions): string | undefined;
|
|
586
|
+
checkIP(ip: string): string | undefined;
|
|
587
|
+
checkIssued(otherCert: X509Certificate): boolean;
|
|
588
|
+
checkPrivateKey(privateKey: KeyObject): boolean;
|
|
589
|
+
toJSON(): string;
|
|
590
|
+
toLegacyObject(): PeerCertificate;
|
|
591
|
+
toString(): string;
|
|
592
|
+
verify(publicKey: KeyObject): boolean;
|
|
593
|
+
}
|
|
594
|
+
type LargeNumberLike = NodeJS.ArrayBufferView | SharedArrayBuffer | ArrayBuffer | bigint;
|
|
595
|
+
interface GeneratePrimeOptions {
|
|
596
|
+
add?: LargeNumberLike | undefined;
|
|
597
|
+
rem?: LargeNumberLike | undefined;
|
|
598
|
+
safe?: boolean | undefined;
|
|
599
|
+
bigint?: boolean | undefined;
|
|
600
|
+
}
|
|
601
|
+
interface GeneratePrimeOptionsBigInt extends GeneratePrimeOptions {
|
|
602
|
+
bigint: true;
|
|
603
|
+
}
|
|
604
|
+
interface GeneratePrimeOptionsArrayBuffer extends GeneratePrimeOptions {
|
|
605
|
+
bigint?: false | undefined;
|
|
606
|
+
}
|
|
607
|
+
function generatePrime(size: number, callback: (err: Error | null, prime: ArrayBuffer) => void): void;
|
|
608
|
+
function generatePrime(size: number, options: GeneratePrimeOptionsBigInt, callback: (err: Error | null, prime: bigint) => void): void;
|
|
609
|
+
function generatePrime(size: number, options: GeneratePrimeOptionsArrayBuffer, callback: (err: Error | null, prime: ArrayBuffer) => void): void;
|
|
610
|
+
function generatePrime(size: number, options: GeneratePrimeOptions, callback: (err: Error | null, prime: ArrayBuffer | bigint) => void): void;
|
|
611
|
+
function generatePrimeSync(size: number): ArrayBuffer;
|
|
612
|
+
function generatePrimeSync(size: number, options: GeneratePrimeOptionsBigInt): bigint;
|
|
613
|
+
function generatePrimeSync(size: number, options: GeneratePrimeOptionsArrayBuffer): ArrayBuffer;
|
|
614
|
+
function generatePrimeSync(size: number, options: GeneratePrimeOptions): ArrayBuffer | bigint;
|
|
615
|
+
interface CheckPrimeOptions {
|
|
616
|
+
checks?: number | undefined;
|
|
617
|
+
}
|
|
618
|
+
function checkPrime(value: LargeNumberLike, callback: (err: Error | null, result: boolean) => void): void;
|
|
619
|
+
function checkPrime(value: LargeNumberLike, options: CheckPrimeOptions, callback: (err: Error | null, result: boolean) => void): void;
|
|
620
|
+
function checkPrimeSync(candidate: LargeNumberLike, options?: CheckPrimeOptions): boolean;
|
|
621
|
+
function setEngine(engine: string, flags?: number): void;
|
|
622
|
+
function getRandomValues<T extends Exclude<NodeJS.NonSharedTypedArray, NodeJS.NonSharedFloat16Array | NodeJS.NonSharedFloat32Array | NodeJS.NonSharedFloat64Array>>(typedArray: T): T;
|
|
623
|
+
type Argon2Algorithm = "argon2d" | "argon2i" | "argon2id";
|
|
624
|
+
interface Argon2Parameters {
|
|
625
|
+
message: string | ArrayBuffer | NodeJS.ArrayBufferView;
|
|
626
|
+
nonce: string | ArrayBuffer | NodeJS.ArrayBufferView;
|
|
627
|
+
parallelism: number;
|
|
628
|
+
tagLength: number;
|
|
629
|
+
memory: number;
|
|
630
|
+
passes: number;
|
|
631
|
+
secret?: string | ArrayBuffer | NodeJS.ArrayBufferView | undefined;
|
|
632
|
+
associatedData?: string | ArrayBuffer | NodeJS.ArrayBufferView | undefined;
|
|
633
|
+
}
|
|
634
|
+
function argon2(algorithm: Argon2Algorithm, parameters: Argon2Parameters, callback: (err: Error | null, derivedKey: NonSharedBuffer) => void): void;
|
|
635
|
+
function argon2Sync(algorithm: Argon2Algorithm, parameters: Argon2Parameters): NonSharedBuffer;
|
|
636
|
+
const subtle: webcrypto.SubtleCrypto;
|
|
637
|
+
const webcrypto: webcrypto.Crypto;
|
|
638
|
+
namespace webcrypto {
|
|
639
|
+
type AlgorithmIdentifier = Algorithm | string;
|
|
640
|
+
type BigInteger = NodeJS.NonSharedUint8Array;
|
|
641
|
+
type KeyFormat = "jwk" | "pkcs8" | "raw" | "raw-public" | "raw-secret" | "raw-seed" | "spki";
|
|
642
|
+
type KeyType = "private" | "public" | "secret";
|
|
643
|
+
type KeyUsage = "decapsulateBits" | "decapsulateKey" | "decrypt" | "deriveBits" | "deriveKey" | "encapsulateBits" | "encapsulateKey" | "encrypt" | "sign" | "unwrapKey" | "verify" | "wrapKey";
|
|
644
|
+
type HashAlgorithmIdentifier = AlgorithmIdentifier;
|
|
645
|
+
type NamedCurve = string;
|
|
646
|
+
interface AeadParams extends Algorithm {
|
|
647
|
+
additionalData?: NodeJS.BufferSource;
|
|
648
|
+
iv: NodeJS.BufferSource;
|
|
649
|
+
tagLength: number;
|
|
650
|
+
}
|
|
651
|
+
interface AesCbcParams extends Algorithm {
|
|
652
|
+
iv: NodeJS.BufferSource;
|
|
653
|
+
}
|
|
654
|
+
interface AesCtrParams extends Algorithm {
|
|
655
|
+
counter: NodeJS.BufferSource;
|
|
656
|
+
length: number;
|
|
657
|
+
}
|
|
658
|
+
interface AesDerivedKeyParams extends Algorithm {
|
|
659
|
+
length: number;
|
|
660
|
+
}
|
|
661
|
+
interface AesKeyAlgorithm extends KeyAlgorithm {
|
|
662
|
+
length: number;
|
|
663
|
+
}
|
|
664
|
+
interface AesKeyGenParams extends Algorithm {
|
|
665
|
+
length: number;
|
|
666
|
+
}
|
|
667
|
+
interface Algorithm {
|
|
668
|
+
name: string;
|
|
669
|
+
}
|
|
670
|
+
interface Argon2Params extends Algorithm {
|
|
671
|
+
associatedData?: NodeJS.BufferSource;
|
|
672
|
+
memory: number;
|
|
673
|
+
nonce: NodeJS.BufferSource;
|
|
674
|
+
parallelism: number;
|
|
675
|
+
passes: number;
|
|
676
|
+
secretValue?: NodeJS.BufferSource;
|
|
677
|
+
version?: number;
|
|
678
|
+
}
|
|
679
|
+
interface CShakeParams extends Algorithm {
|
|
680
|
+
customization?: NodeJS.BufferSource;
|
|
681
|
+
functionName?: NodeJS.BufferSource;
|
|
682
|
+
outputLength: number;
|
|
683
|
+
}
|
|
684
|
+
interface ContextParams extends Algorithm {
|
|
685
|
+
context?: NodeJS.BufferSource;
|
|
686
|
+
}
|
|
687
|
+
interface EcKeyAlgorithm extends KeyAlgorithm {
|
|
688
|
+
namedCurve: NamedCurve;
|
|
689
|
+
}
|
|
690
|
+
interface EcKeyGenParams extends Algorithm {
|
|
691
|
+
namedCurve: NamedCurve;
|
|
692
|
+
}
|
|
693
|
+
interface EcKeyImportParams extends Algorithm {
|
|
694
|
+
namedCurve: NamedCurve;
|
|
695
|
+
}
|
|
696
|
+
interface EcdhKeyDeriveParams extends Algorithm {
|
|
697
|
+
public: CryptoKey;
|
|
698
|
+
}
|
|
699
|
+
interface EcdsaParams extends Algorithm {
|
|
700
|
+
hash: HashAlgorithmIdentifier;
|
|
701
|
+
}
|
|
702
|
+
interface HkdfParams extends Algorithm {
|
|
703
|
+
hash: HashAlgorithmIdentifier;
|
|
704
|
+
info: NodeJS.BufferSource;
|
|
705
|
+
salt: NodeJS.BufferSource;
|
|
706
|
+
}
|
|
707
|
+
interface HmacImportParams extends Algorithm {
|
|
708
|
+
hash: HashAlgorithmIdentifier;
|
|
709
|
+
length?: number;
|
|
710
|
+
}
|
|
711
|
+
interface HmacKeyAlgorithm extends KeyAlgorithm {
|
|
712
|
+
hash: KeyAlgorithm;
|
|
713
|
+
length: number;
|
|
714
|
+
}
|
|
715
|
+
interface HmacKeyGenParams extends Algorithm {
|
|
716
|
+
hash: HashAlgorithmIdentifier;
|
|
717
|
+
length?: number;
|
|
718
|
+
}
|
|
719
|
+
interface KangarooTwelveParams {
|
|
720
|
+
customization?: NodeJS.BufferSource;
|
|
721
|
+
outputLength: number;
|
|
722
|
+
}
|
|
723
|
+
interface JsonWebKey {
|
|
724
|
+
alg?: string;
|
|
725
|
+
crv?: string;
|
|
726
|
+
d?: string;
|
|
727
|
+
dp?: string;
|
|
728
|
+
dq?: string;
|
|
729
|
+
e?: string;
|
|
730
|
+
ext?: boolean;
|
|
731
|
+
k?: string;
|
|
732
|
+
key_ops?: string[];
|
|
733
|
+
kty?: string;
|
|
734
|
+
n?: string;
|
|
735
|
+
oth?: RsaOtherPrimesInfo[];
|
|
736
|
+
p?: string;
|
|
737
|
+
q?: string;
|
|
738
|
+
qi?: string;
|
|
739
|
+
use?: string;
|
|
740
|
+
x?: string;
|
|
741
|
+
y?: string;
|
|
742
|
+
}
|
|
743
|
+
interface KeyAlgorithm {
|
|
744
|
+
name: string;
|
|
745
|
+
}
|
|
746
|
+
interface KmacImportParams extends Algorithm {
|
|
747
|
+
length?: number;
|
|
748
|
+
}
|
|
749
|
+
interface KmacKeyAlgorithm extends KeyAlgorithm {
|
|
750
|
+
length: number;
|
|
751
|
+
}
|
|
752
|
+
interface KmacKeyGenParams extends Algorithm {
|
|
753
|
+
length?: number;
|
|
754
|
+
}
|
|
755
|
+
interface KmacParams extends Algorithm {
|
|
756
|
+
customization?: NodeJS.BufferSource;
|
|
757
|
+
outputLength: number;
|
|
758
|
+
}
|
|
759
|
+
interface Pbkdf2Params extends Algorithm {
|
|
760
|
+
hash: HashAlgorithmIdentifier;
|
|
761
|
+
iterations: number;
|
|
762
|
+
salt: NodeJS.BufferSource;
|
|
763
|
+
}
|
|
764
|
+
interface RsaHashedImportParams extends Algorithm {
|
|
765
|
+
hash: HashAlgorithmIdentifier;
|
|
766
|
+
}
|
|
767
|
+
interface RsaHashedKeyAlgorithm extends RsaKeyAlgorithm {
|
|
768
|
+
hash: KeyAlgorithm;
|
|
769
|
+
}
|
|
770
|
+
interface RsaHashedKeyGenParams extends RsaKeyGenParams {
|
|
771
|
+
hash: HashAlgorithmIdentifier;
|
|
772
|
+
}
|
|
773
|
+
interface RsaKeyAlgorithm extends KeyAlgorithm {
|
|
774
|
+
modulusLength: number;
|
|
775
|
+
publicExponent: BigInteger;
|
|
776
|
+
}
|
|
777
|
+
interface RsaKeyGenParams extends Algorithm {
|
|
778
|
+
modulusLength: number;
|
|
779
|
+
publicExponent: BigInteger;
|
|
780
|
+
}
|
|
781
|
+
interface RsaOaepParams extends Algorithm {
|
|
782
|
+
label?: NodeJS.BufferSource;
|
|
783
|
+
}
|
|
784
|
+
interface RsaOtherPrimesInfo {
|
|
785
|
+
d?: string;
|
|
786
|
+
r?: string;
|
|
787
|
+
t?: string;
|
|
788
|
+
}
|
|
789
|
+
interface RsaPssParams extends Algorithm {
|
|
790
|
+
saltLength: number;
|
|
791
|
+
}
|
|
792
|
+
interface TurboShakeParams {
|
|
793
|
+
domainSeparation?: number;
|
|
794
|
+
outputLength: number;
|
|
795
|
+
}
|
|
796
|
+
interface Crypto {
|
|
797
|
+
readonly subtle: SubtleCrypto;
|
|
798
|
+
getRandomValues<T extends Exclude<NodeJS.NonSharedTypedArray, NodeJS.NonSharedFloat16Array | NodeJS.NonSharedFloat32Array | NodeJS.NonSharedFloat64Array>>(typedArray: T): T;
|
|
799
|
+
randomUUID(): UUID;
|
|
800
|
+
}
|
|
801
|
+
interface CryptoKey {
|
|
802
|
+
readonly algorithm: KeyAlgorithm;
|
|
803
|
+
readonly extractable: boolean;
|
|
804
|
+
readonly type: KeyType;
|
|
805
|
+
readonly usages: KeyUsage[];
|
|
806
|
+
}
|
|
807
|
+
interface CryptoKeyPair {
|
|
808
|
+
privateKey: CryptoKey;
|
|
809
|
+
publicKey: CryptoKey;
|
|
810
|
+
}
|
|
811
|
+
interface EncapsulatedBits {
|
|
812
|
+
sharedKey: ArrayBuffer;
|
|
813
|
+
ciphertext: ArrayBuffer;
|
|
814
|
+
}
|
|
815
|
+
interface EncapsulatedKey {
|
|
816
|
+
sharedKey: CryptoKey;
|
|
817
|
+
ciphertext: ArrayBuffer;
|
|
818
|
+
}
|
|
819
|
+
interface SubtleCrypto {
|
|
820
|
+
decapsulateBits(decapsulationAlgorithm: AlgorithmIdentifier, decapsulationKey: CryptoKey, ciphertext: NodeJS.BufferSource): Promise<ArrayBuffer>;
|
|
821
|
+
decapsulateKey(decapsulationAlgorithm: AlgorithmIdentifier, decapsulationKey: CryptoKey, ciphertext: NodeJS.BufferSource, sharedKeyAlgorithm: AlgorithmIdentifier | HmacImportParams | AesDerivedKeyParams | KmacImportParams, extractable: boolean, usages: KeyUsage[]): Promise<CryptoKey>;
|
|
822
|
+
decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams, key: CryptoKey, data: NodeJS.BufferSource): Promise<ArrayBuffer>;
|
|
823
|
+
deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params, baseKey: CryptoKey, length?: number | null): Promise<ArrayBuffer>;
|
|
824
|
+
deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params | Argon2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | KmacImportParams, extractable: boolean, keyUsages: readonly KeyUsage[]): Promise<CryptoKey>;
|
|
825
|
+
digest(algorithm: AlgorithmIdentifier | CShakeParams | TurboShakeParams | KangarooTwelveParams, data: NodeJS.BufferSource): Promise<ArrayBuffer>;
|
|
826
|
+
encapsulateBits(encapsulationAlgorithm: AlgorithmIdentifier, encapsulationKey: CryptoKey): Promise<EncapsulatedBits>;
|
|
827
|
+
encapsulateKey(encapsulationAlgorithm: AlgorithmIdentifier, encapsulationKey: CryptoKey, sharedKeyAlgorithm: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | KmacImportParams, extractable: boolean, usages: KeyUsage[]): Promise<EncapsulatedKey>;
|
|
828
|
+
encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams, key: CryptoKey, data: NodeJS.BufferSource): Promise<ArrayBuffer>;
|
|
829
|
+
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
|
|
830
|
+
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
|
|
831
|
+
exportKey(format: KeyFormat, key: CryptoKey): Promise<ArrayBuffer | JsonWebKey>;
|
|
832
|
+
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair>;
|
|
833
|
+
generateKey(algorithm: AesKeyGenParams | HmacKeyGenParams | Pbkdf2Params | KmacKeyGenParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
|
|
834
|
+
generateKey(algorithm: AlgorithmIdentifier, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKeyPair | CryptoKey>;
|
|
835
|
+
getPublicKey(key: CryptoKey, keyUsages: KeyUsage[]): Promise<CryptoKey>;
|
|
836
|
+
importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm | KmacImportParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
|
|
837
|
+
importKey(format: Exclude<KeyFormat, "jwk">, keyData: NodeJS.BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm | KmacImportParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
|
|
838
|
+
sign(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | ContextParams | KmacParams, key: CryptoKey, data: NodeJS.BufferSource): Promise<ArrayBuffer>;
|
|
839
|
+
unwrapKey(format: KeyFormat, wrappedKey: NodeJS.BufferSource, unwrappingKey: CryptoKey, unwrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams, unwrappedKeyAlgorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm | KmacImportParams, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
|
|
840
|
+
verify(algorithm: AlgorithmIdentifier | RsaPssParams | EcdsaParams | ContextParams | KmacParams, key: CryptoKey, signature: NodeJS.BufferSource, data: NodeJS.BufferSource): Promise<boolean>;
|
|
841
|
+
wrapKey(format: KeyFormat, key: CryptoKey, wrappingKey: CryptoKey, wrapAlgorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AeadParams): Promise<ArrayBuffer>;
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
declare module "crypto" {
|
|
846
|
+
export * from "node:crypto";
|
|
847
|
+
}
|