@suveren/gateway 0.7.6 → 0.8.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.
Files changed (161) hide show
  1. package/content/integrations/mollie.json +103 -28
  2. package/dist/mcp-server/http.mjs +228 -118
  3. package/dist/ui/assets/{index-CsrM6RQr.js → index-BFnSVa9N.js} +22 -22
  4. package/dist/ui/index.html +1 -1
  5. package/node_modules/@hap/core/dist/index.d.mts +29 -6
  6. package/node_modules/@hap/core/dist/index.d.ts +29 -6
  7. package/node_modules/@hap/core/dist/index.js +54 -8
  8. package/node_modules/@hap/core/dist/index.mjs +53 -8
  9. package/node_modules/@hap/core/package.json +2 -1
  10. package/node_modules/@hap/core/src/frame.ts +115 -14
  11. package/node_modules/@hap/core/src/gatekeeper.ts +26 -0
  12. package/node_modules/@hap/core/src/types.ts +7 -1
  13. package/node_modules/@types/node/README.md +1 -1
  14. package/node_modules/@types/node/buffer.buffer.d.ts +5 -0
  15. package/node_modules/@types/node/crypto.d.ts +0 -2
  16. package/node_modules/@types/node/dgram.d.ts +119 -4
  17. package/node_modules/@types/node/ffi.d.ts +1 -1
  18. package/node_modules/@types/node/fs/promises.d.ts +61 -65
  19. package/node_modules/@types/node/fs.d.ts +86 -76
  20. package/node_modules/@types/node/http.d.ts +1 -1
  21. package/node_modules/@types/node/http2.d.ts +2 -2
  22. package/node_modules/@types/node/index.d.ts +1 -0
  23. package/node_modules/@types/node/inspector.d.ts +2 -1
  24. package/node_modules/@types/node/net.d.ts +108 -16
  25. package/node_modules/@types/node/package.json +2 -2
  26. package/node_modules/@types/node/quic.d.ts +37 -11
  27. package/node_modules/@types/node/stream/iter.d.ts +4 -4
  28. package/node_modules/@types/node/tls.d.ts +24 -0
  29. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +5 -0
  30. package/node_modules/@types/node/ts5.6/index.d.ts +1 -0
  31. package/node_modules/@types/node/ts5.7/index.d.ts +1 -0
  32. package/node_modules/@types/node/tty.d.ts +4 -3
  33. package/node_modules/@types/node/vfs.d.ts +210 -0
  34. package/node_modules/@types/node/vm.d.ts +1 -1
  35. package/node_modules/express-rate-limit/dist/index.cjs +6 -3
  36. package/node_modules/express-rate-limit/dist/index.d.cts +11 -0
  37. package/node_modules/express-rate-limit/dist/index.d.mts +11 -0
  38. package/node_modules/express-rate-limit/dist/index.d.ts +11 -0
  39. package/node_modules/express-rate-limit/dist/index.mjs +6 -3
  40. package/node_modules/express-rate-limit/{license.md → license} +7 -6
  41. package/node_modules/express-rate-limit/package.json +5 -5
  42. package/node_modules/express-rate-limit/readme.md +1 -0
  43. package/node_modules/fast-uri/index.js +20 -5
  44. package/node_modules/fast-uri/lib/utils.js +8 -1
  45. package/node_modules/fast-uri/package.json +1 -1
  46. package/node_modules/fast-uri/test/component-safe-serialization.test.js +58 -0
  47. package/node_modules/fast-uri/test/ipv6-validation.test.js +34 -0
  48. package/node_modules/ip-address/README.md +92 -82
  49. package/node_modules/ip-address/dist/common.d.ts +20 -0
  50. package/node_modules/ip-address/dist/common.js +36 -0
  51. package/node_modules/ip-address/dist/common.js.map +1 -1
  52. package/node_modules/ip-address/dist/ipv4.d.ts +50 -0
  53. package/node_modules/ip-address/dist/ipv4.js +75 -0
  54. package/node_modules/ip-address/dist/ipv4.js.map +1 -1
  55. package/node_modules/ip-address/dist/ipv6.d.ts +79 -10
  56. package/node_modules/ip-address/dist/ipv6.js +120 -30
  57. package/node_modules/ip-address/dist/ipv6.js.map +1 -1
  58. package/node_modules/ip-address/dist/v4/constants.d.ts +12 -0
  59. package/node_modules/ip-address/dist/v4/constants.js +40 -1
  60. package/node_modules/ip-address/dist/v4/constants.js.map +1 -1
  61. package/node_modules/ip-address/dist/v6/constants.d.ts +14 -0
  62. package/node_modules/ip-address/dist/v6/constants.js +47 -1
  63. package/node_modules/ip-address/dist/v6/constants.js.map +1 -1
  64. package/node_modules/ip-address/package.json +1 -1
  65. package/node_modules/jose/dist/types/jwe/compact/decrypt.d.ts +7 -16
  66. package/node_modules/jose/dist/types/jwe/compact/encrypt.d.ts +6 -17
  67. package/node_modules/jose/dist/types/jwe/flattened/decrypt.d.ts +7 -16
  68. package/node_modules/jose/dist/types/jwe/flattened/encrypt.d.ts +11 -34
  69. package/node_modules/jose/dist/types/jwe/general/decrypt.d.ts +7 -16
  70. package/node_modules/jose/dist/types/jwe/general/encrypt.d.ts +15 -35
  71. package/node_modules/jose/dist/types/jwk/embedded.d.ts +3 -8
  72. package/node_modules/jose/dist/types/jwk/thumbprint.d.ts +5 -5
  73. package/node_modules/jose/dist/types/jwks/local.d.ts +6 -10
  74. package/node_modules/jose/dist/types/jwks/remote.d.ts +13 -24
  75. package/node_modules/jose/dist/types/jws/compact/sign.d.ts +5 -10
  76. package/node_modules/jose/dist/types/jws/compact/verify.d.ts +9 -18
  77. package/node_modules/jose/dist/types/jws/flattened/sign.d.ts +7 -16
  78. package/node_modules/jose/dist/types/jws/flattened/verify.d.ts +9 -18
  79. package/node_modules/jose/dist/types/jws/general/sign.d.ts +11 -21
  80. package/node_modules/jose/dist/types/jws/general/verify.d.ts +9 -18
  81. package/node_modules/jose/dist/types/jwt/decrypt.d.ts +10 -20
  82. package/node_modules/jose/dist/types/jwt/encrypt.d.ts +6 -13
  83. package/node_modules/jose/dist/types/jwt/sign.d.ts +5 -6
  84. package/node_modules/jose/dist/types/jwt/unsecured.d.ts +9 -14
  85. package/node_modules/jose/dist/types/jwt/verify.d.ts +9 -19
  86. package/node_modules/jose/dist/types/key/export.d.ts +4 -4
  87. package/node_modules/jose/dist/types/key/generate_key_pair.d.ts +6 -8
  88. package/node_modules/jose/dist/types/key/generate_secret.d.ts +4 -11
  89. package/node_modules/jose/dist/types/key/import.d.ts +10 -17
  90. package/node_modules/jose/dist/types/types.d.ts +44 -84
  91. package/node_modules/jose/dist/types/util/base64url.d.ts +2 -2
  92. package/node_modules/jose/dist/types/util/decode_jwt.d.ts +3 -10
  93. package/node_modules/jose/dist/types/util/decode_protected_header.d.ts +4 -4
  94. package/node_modules/jose/dist/types/util/errors.d.ts +26 -53
  95. package/node_modules/jose/dist/webapi/index.js +70 -32
  96. package/node_modules/jose/dist/webapi/jwe/compact/decrypt.js +7 -8
  97. package/node_modules/jose/dist/webapi/jwe/compact/encrypt.js +42 -48
  98. package/node_modules/jose/dist/webapi/jwe/flattened/decrypt.js +14 -14
  99. package/node_modules/jose/dist/webapi/jwe/flattened/encrypt.js +53 -64
  100. package/node_modules/jose/dist/webapi/jwe/general/decrypt.js +38 -49
  101. package/node_modules/jose/dist/webapi/jwe/general/encrypt.js +121 -169
  102. package/node_modules/jose/dist/webapi/jwk/embedded.js +30 -32
  103. package/node_modules/jose/dist/webapi/jwk/thumbprint.js +54 -70
  104. package/node_modules/jose/dist/webapi/jwks/local.js +47 -64
  105. package/node_modules/jose/dist/webapi/jwks/remote.js +88 -136
  106. package/node_modules/jose/dist/webapi/jws/compact/sign.js +21 -21
  107. package/node_modules/jose/dist/webapi/jws/compact/verify.js +7 -8
  108. package/node_modules/jose/dist/webapi/jws/flattened/sign.js +29 -31
  109. package/node_modules/jose/dist/webapi/jws/flattened/verify.js +21 -24
  110. package/node_modules/jose/dist/webapi/jws/general/sign.js +61 -72
  111. package/node_modules/jose/dist/webapi/jws/general/verify.js +45 -69
  112. package/node_modules/jose/dist/webapi/jwt/decrypt.js +13 -20
  113. package/node_modules/jose/dist/webapi/jwt/encrypt.js +57 -70
  114. package/node_modules/jose/dist/webapi/jwt/sign.js +17 -16
  115. package/node_modules/jose/dist/webapi/jwt/unsecured.js +32 -40
  116. package/node_modules/jose/dist/webapi/jwt/verify.js +12 -14
  117. package/node_modules/jose/dist/webapi/key/export.js +32 -37
  118. package/node_modules/jose/dist/webapi/key/generate_key_pair.js +40 -48
  119. package/node_modules/jose/dist/webapi/key/generate_secret.js +35 -40
  120. package/node_modules/jose/dist/webapi/key/import.js +52 -56
  121. package/node_modules/jose/dist/webapi/lib/asn1.js +130 -169
  122. package/node_modules/jose/dist/webapi/lib/base64.js +18 -20
  123. package/node_modules/jose/dist/webapi/lib/buffer_utils.js +34 -38
  124. package/node_modules/jose/dist/webapi/lib/content_encryption.js +79 -115
  125. package/node_modules/jose/dist/webapi/lib/crypto_key.js +24 -25
  126. package/node_modules/jose/dist/webapi/lib/deflate.js +45 -47
  127. package/node_modules/jose/dist/webapi/lib/helpers.js +40 -37
  128. package/node_modules/jose/dist/webapi/lib/invalid_key_input.js +10 -24
  129. package/node_modules/jose/dist/webapi/lib/is_key_like.js +17 -15
  130. package/node_modules/jose/dist/webapi/lib/jwe_algorithms.js +106 -93
  131. package/node_modules/jose/dist/webapi/lib/jwe_decrypt.js +207 -230
  132. package/node_modules/jose/dist/webapi/lib/jwe_encrypt.js +104 -138
  133. package/node_modules/jose/dist/webapi/lib/jwk_metadata.js +17 -18
  134. package/node_modules/jose/dist/webapi/lib/jwk_to_key.js +9 -16
  135. package/node_modules/jose/dist/webapi/lib/jws_algorithms.js +62 -61
  136. package/node_modules/jose/dist/webapi/lib/jws_sign.js +50 -75
  137. package/node_modules/jose/dist/webapi/lib/jws_verify.js +80 -125
  138. package/node_modules/jose/dist/webapi/lib/jwt_claims_set.js +123 -209
  139. package/node_modules/jose/dist/webapi/lib/key.js +84 -136
  140. package/node_modules/jose/dist/webapi/lib/key_algorithm.js +13 -8
  141. package/node_modules/jose/dist/webapi/lib/key_descriptor.js +8 -6
  142. package/node_modules/jose/dist/webapi/lib/key_management.js +200 -231
  143. package/node_modules/jose/dist/webapi/lib/key_options.js +7 -5
  144. package/node_modules/jose/dist/webapi/lib/options.js +55 -68
  145. package/node_modules/jose/dist/webapi/lib/signing.js +18 -22
  146. package/node_modules/jose/dist/webapi/lib/type_checks.js +26 -29
  147. package/node_modules/jose/dist/webapi/util/base64url.js +26 -35
  148. package/node_modules/jose/dist/webapi/util/decode_jwt.js +32 -31
  149. package/node_modules/jose/dist/webapi/util/decode_protected_header.js +18 -23
  150. package/node_modules/jose/dist/webapi/util/errors.js +94 -84
  151. package/node_modules/jose/package.json +17 -81
  152. package/package.json +2 -2
  153. package/profiles/calendar/0.5.profile.json +190 -0
  154. package/profiles/charge/0.5.profile.json +210 -0
  155. package/profiles/customers/0.7.profile.json +157 -0
  156. package/profiles/deploy/0.9.profile.json +176 -0
  157. package/profiles/email/0.6.profile.json +208 -0
  158. package/profiles/index.json +9 -1
  159. package/profiles/publish/0.5.profile.json +186 -0
  160. package/profiles/purchase/0.5.profile.json +231 -0
  161. package/profiles/records/0.5.profile.json +117 -0
@@ -1,37 +1,28 @@
1
- import type * as types from '../../types.d.ts';
2
- /**
3
- * Interface for Compact JWS Verification dynamic key resolution. No token components have been
4
- * verified at the time of this function call.
5
- */
6
- export interface CompactVerifyGetKey<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array> extends types.GetKeyFunction<types.CompactJWSHeaderParameters, types.FlattenedJWSInput, KeyType | types.KeyObject | types.JWK> {
1
+ import type * as t from '../../types.d.ts';
2
+ /** Dynamic key resolver for Compact JWS verification. */
3
+ export interface CompactVerifyGetKey<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array> extends t.GetKeyFunction<t.CompactJWSHeaderParameters, t.FlattenedJWSInput, KeyType | t.KeyObject | t.JWK> {
7
4
  }
8
5
  /**
9
- * Verifies the signature and format of and afterwards decodes the Compact JWS.
6
+ * Verifies a Compact JWS signature and decodes its payload.
10
7
  *
11
- * @param jws Compact JWS.
12
8
  * @param key Key to verify the JWS with. See
13
9
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
14
- * @param options JWS Verify options.
15
10
  */
16
- export declare function compactVerify(jws: string | Uint8Array, key: types.KeyInput, options?: types.VerifyOptions): Promise<types.CompactVerifyResult>;
11
+ export declare function compactVerify(jws: string | Uint8Array, key: t.KeyInput, options?: t.VerifyOptions): Promise<t.CompactVerifyResult>;
17
12
  /**
18
- * Verifies the signature and format of and afterwards decodes the Compact JWS, resolving the key
19
- * dynamically. The result additionally carries the {@link types.ResolvedKey.key resolved key}.
13
+ * Verifies a Compact JWS signature and decodes its payload, resolving the key dynamically. The
14
+ * result additionally carries the {@link t.ResolvedKey.key resolved key}.
20
15
  *
21
- * @param jws Compact JWS.
22
16
  * @param getKey Function resolving a key to verify the JWS with. See
23
17
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
24
- * @param options JWS Verify options.
25
18
  */
26
- export declare function compactVerify<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array>(jws: string | Uint8Array, getKey: CompactVerifyGetKey<KeyType>, options?: types.VerifyOptions): Promise<types.CompactVerifyResult & types.ResolvedKey<KeyType>>;
19
+ export declare function compactVerify<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array>(jws: string | Uint8Array, getKey: CompactVerifyGetKey<KeyType>, options?: t.VerifyOptions): Promise<t.CompactVerifyResult & t.ResolvedKey<KeyType>>;
27
20
  /**
28
21
  * Accepts either form of the `key` argument. Use this overload when forwarding a value that may be
29
22
  * either a key or a key resolution function; `key` is present on the result only when a resolution
30
23
  * function was used.
31
24
  *
32
- * @param jws Compact JWS.
33
25
  * @param key Key, or function resolving a key, to verify the JWS with. See
34
26
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
35
- * @param options JWS Verify options.
36
27
  */
37
- export declare function compactVerify(jws: string | Uint8Array, key: types.KeyInput | CompactVerifyGetKey, options?: types.VerifyOptions): Promise<types.CompactVerifyResult & Partial<types.ResolvedKey>>;
28
+ export declare function compactVerify(jws: string | Uint8Array, key: t.KeyInput | CompactVerifyGetKey, options?: t.VerifyOptions): Promise<t.CompactVerifyResult & Partial<t.ResolvedKey>>;
@@ -1,5 +1,5 @@
1
- import type * as types from '../../types.d.ts';
2
- /** The FlattenedSign class is used to build and sign Flattened JWS objects. */
1
+ import type * as t from '../../types.d.ts';
2
+ /** Builds and signs Flattened JWS objects. */
3
3
  export declare class FlattenedSign {
4
4
  #private;
5
5
  /**
@@ -8,24 +8,15 @@ export declare class FlattenedSign {
8
8
  * @param payload Binary representation of the payload to sign.
9
9
  */
10
10
  constructor(payload: Uint8Array);
11
- /**
12
- * Sets the JWS Protected Header on the FlattenedSign object.
13
- *
14
- * @param protectedHeader JWS Protected Header.
15
- */
16
- setProtectedHeader(protectedHeader: types.JWSHeaderParameters): this;
17
- /**
18
- * Sets the JWS Unprotected Header on the FlattenedSign object.
19
- *
20
- * @param unprotectedHeader JWS Unprotected Header.
21
- */
22
- setUnprotectedHeader(unprotectedHeader: types.JWSHeaderParameters): this;
11
+ /** Sets the JWS Protected Header on the FlattenedSign object. */
12
+ setProtectedHeader(protectedHeader: t.JWSHeaderParameters): this;
13
+ /** Sets the JWS Unprotected Header on the FlattenedSign object. */
14
+ setUnprotectedHeader(unprotectedHeader: t.JWSHeaderParameters): this;
23
15
  /**
24
16
  * Signs and resolves the value of the Flattened JWS object.
25
17
  *
26
18
  * @param key Private Key or Secret to sign the JWS with. See
27
19
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
28
- * @param options JWS Sign options.
29
20
  */
30
- sign(key: types.KeyInput, options?: types.SignOptions): Promise<types.FlattenedJWS>;
21
+ sign(key: t.KeyInput, options?: t.SignOptions): Promise<t.FlattenedJWS>;
31
22
  }
@@ -1,37 +1,28 @@
1
- import type * as types from '../../types.d.ts';
2
- /**
3
- * Interface for Flattened JWS Verification dynamic key resolution. No token components have been
4
- * verified at the time of this function call.
5
- */
6
- export interface FlattenedVerifyGetKey<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array> extends types.GetKeyFunction<types.JWSHeaderParameters, types.FlattenedJWSInput, KeyType | types.KeyObject | types.JWK> {
1
+ import type * as t from '../../types.d.ts';
2
+ /** Dynamic key resolver for Flattened JWS verification. */
3
+ export interface FlattenedVerifyGetKey<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array> extends t.GetKeyFunction<t.JWSHeaderParameters, t.FlattenedJWSInput, KeyType | t.KeyObject | t.JWK> {
7
4
  }
8
5
  /**
9
- * Verifies the signature and format of and afterwards decodes the Flattened JWS.
6
+ * Verifies a Flattened JWS signature and decodes its payload.
10
7
  *
11
- * @param jws Flattened JWS.
12
8
  * @param key Key to verify the JWS with. See
13
9
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
14
- * @param options JWS Verify options.
15
10
  */
16
- export declare function flattenedVerify(jws: types.FlattenedJWSInput, key: types.KeyInput, options?: types.VerifyOptions): Promise<types.FlattenedVerifyResult>;
11
+ export declare function flattenedVerify(jws: t.FlattenedJWSInput, key: t.KeyInput, options?: t.VerifyOptions): Promise<t.FlattenedVerifyResult>;
17
12
  /**
18
- * Verifies the signature and format of and afterwards decodes the Flattened JWS, resolving the key
19
- * dynamically. The result additionally carries the {@link types.ResolvedKey.key resolved key}.
13
+ * Verifies a Flattened JWS signature and decodes its payload, resolving the key dynamically. The
14
+ * result additionally carries the {@link t.ResolvedKey.key resolved key}.
20
15
  *
21
- * @param jws Flattened JWS.
22
16
  * @param getKey Function resolving a key to verify the JWS with. See
23
17
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
24
- * @param options JWS Verify options.
25
18
  */
26
- export declare function flattenedVerify<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array>(jws: types.FlattenedJWSInput, getKey: FlattenedVerifyGetKey<KeyType>, options?: types.VerifyOptions): Promise<types.FlattenedVerifyResult & types.ResolvedKey<KeyType>>;
19
+ export declare function flattenedVerify<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array>(jws: t.FlattenedJWSInput, getKey: FlattenedVerifyGetKey<KeyType>, options?: t.VerifyOptions): Promise<t.FlattenedVerifyResult & t.ResolvedKey<KeyType>>;
27
20
  /**
28
21
  * Accepts either form of the `key` argument. Use this overload when forwarding a value that may be
29
22
  * either a key or a key resolution function; `key` is present on the result only when a resolution
30
23
  * function was used.
31
24
  *
32
- * @param jws Flattened JWS.
33
25
  * @param key Key, or function resolving a key, to verify the JWS with. See
34
26
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
35
- * @param options JWS Verify options.
36
27
  */
37
- export declare function flattenedVerify(jws: types.FlattenedJWSInput, key: types.KeyInput | FlattenedVerifyGetKey, options?: types.VerifyOptions): Promise<types.FlattenedVerifyResult & Partial<types.ResolvedKey>>;
28
+ export declare function flattenedVerify(jws: t.FlattenedJWSInput, key: t.KeyInput | FlattenedVerifyGetKey, options?: t.VerifyOptions): Promise<t.FlattenedVerifyResult & Partial<t.ResolvedKey>>;
@@ -1,36 +1,27 @@
1
- import type * as types from '../../types.d.ts';
2
- /** Used to build General JWS object's individual signatures. */
1
+ import type * as t from '../../types.d.ts';
2
+ /** Configures an individual signature in a General JWS. */
3
3
  export interface Signature {
4
- /**
5
- * Sets the JWS Protected Header on the Signature object.
6
- *
7
- * @param protectedHeader JWS Protected Header.
8
- */
9
- setProtectedHeader(protectedHeader: types.JWSHeaderParameters): Signature;
10
- /**
11
- * Sets the JWS Unprotected Header on the Signature object.
12
- *
13
- * @param unprotectedHeader JWS Unprotected Header.
14
- */
15
- setUnprotectedHeader(unprotectedHeader: types.JWSHeaderParameters): Signature;
4
+ /** Sets the JWS Protected Header on the Signature object. */
5
+ setProtectedHeader(protectedHeader: t.JWSHeaderParameters): Signature;
6
+ /** Sets the JWS Unprotected Header on the Signature object. */
7
+ setUnprotectedHeader(unprotectedHeader: t.JWSHeaderParameters): Signature;
16
8
  /**
17
9
  * A shorthand for calling {@link GeneralSign.addSignature addSignature()} on the enclosing
18
10
  * {@link GeneralSign} instance.
19
11
  *
20
12
  * @param key Private Key or Secret to sign the individual JWS signature with. See
21
13
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
22
- * @param options JWS Sign options.
23
14
  */
24
- addSignature(key: types.KeyInput, options?: types.SignOptions): Signature;
15
+ addSignature(key: t.KeyInput, options?: t.SignOptions): Signature;
25
16
  /**
26
17
  * A shorthand for calling {@link GeneralSign.sign sign()} on the enclosing {@link GeneralSign}
27
18
  * instance. Takes no arguments — each signature's key is supplied to {@link addSignature}.
28
19
  */
29
- sign(): Promise<types.GeneralJWS>;
20
+ sign(): Promise<t.GeneralJWS>;
30
21
  /** Returns the enclosing {@link GeneralSign} instance */
31
22
  done(): GeneralSign;
32
23
  }
33
- /** The GeneralSign class is used to build and sign General JWS objects. */
24
+ /** Builds and signs General JWS objects. */
34
25
  export declare class GeneralSign {
35
26
  #private;
36
27
  /**
@@ -44,9 +35,8 @@ export declare class GeneralSign {
44
35
  *
45
36
  * @param key Private Key or Secret to sign the individual JWS signature with. See
46
37
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
47
- * @param options JWS Sign options.
48
38
  */
49
- addSignature(key: types.KeyInput, options?: types.SignOptions): Signature;
39
+ addSignature(key: t.KeyInput, options?: t.SignOptions): Signature;
50
40
  /** Signs and resolves the value of the General JWS object. */
51
- sign(): Promise<types.GeneralJWS>;
41
+ sign(): Promise<t.GeneralJWS>;
52
42
  }
@@ -1,12 +1,9 @@
1
- import type * as types from '../../types.d.ts';
2
- /**
3
- * Interface for General JWS Verification dynamic key resolution. No token components have been
4
- * verified at the time of this function call.
5
- */
6
- export interface GeneralVerifyGetKey<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array> extends types.GetKeyFunction<types.JWSHeaderParameters, types.FlattenedJWSInput, KeyType | types.KeyObject | types.JWK> {
1
+ import type * as t from '../../types.d.ts';
2
+ /** Dynamic key resolver for General JWS verification. */
3
+ export interface GeneralVerifyGetKey<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array> extends t.GetKeyFunction<t.JWSHeaderParameters, t.FlattenedJWSInput, KeyType | t.KeyObject | t.JWK> {
7
4
  }
8
5
  /**
9
- * Verifies the signature and format of and afterwards decodes the General JWS.
6
+ * Verifies a General JWS signature and decodes its payload.
10
7
  *
11
8
  * > Note: The function iterates over the `signatures` array in the General JWS and returns the verification
12
9
  * > result of the first signature entry that can be successfully verified. The result only contains
@@ -15,30 +12,24 @@ export interface GeneralVerifyGetKey<KeyType extends types.CryptoKey | Uint8Arra
15
12
  * > JWS Unencoded Payload Option, and their headers are not included in the returned result.
16
13
  * > Recipients of a General JWS should only rely on the returned (verified) data.
17
14
  *
18
- * @param jws General JWS.
19
15
  * @param key Key to verify the JWS with. See
20
16
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
21
- * @param options JWS Verify options.
22
17
  */
23
- export declare function generalVerify(jws: types.GeneralJWSInput, key: types.KeyInput, options?: types.VerifyOptions): Promise<types.GeneralVerifyResult>;
18
+ export declare function generalVerify(jws: t.GeneralJWSInput, key: t.KeyInput, options?: t.VerifyOptions): Promise<t.GeneralVerifyResult>;
24
19
  /**
25
- * Verifies the signature and format of and afterwards decodes the General JWS, resolving the key
26
- * dynamically. The result additionally carries the {@link types.ResolvedKey.key resolved key}.
20
+ * Verifies a General JWS signature and decodes its payload, resolving the key dynamically. The
21
+ * result additionally carries the {@link t.ResolvedKey.key resolved key}.
27
22
  *
28
- * @param jws General JWS.
29
23
  * @param getKey Function resolving a key to verify the JWS with. See
30
24
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
31
- * @param options JWS Verify options.
32
25
  */
33
- export declare function generalVerify<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array>(jws: types.GeneralJWSInput, getKey: GeneralVerifyGetKey<KeyType>, options?: types.VerifyOptions): Promise<types.GeneralVerifyResult & types.ResolvedKey<KeyType>>;
26
+ export declare function generalVerify<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array>(jws: t.GeneralJWSInput, getKey: GeneralVerifyGetKey<KeyType>, options?: t.VerifyOptions): Promise<t.GeneralVerifyResult & t.ResolvedKey<KeyType>>;
34
27
  /**
35
28
  * Accepts either form of the `key` argument. Use this overload when forwarding a value that may be
36
29
  * either a key or a key resolution function; `key` is present on the result only when a resolution
37
30
  * function was used.
38
31
  *
39
- * @param jws General JWS.
40
32
  * @param key Key, or function resolving a key, to verify the JWS with. See
41
33
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
42
- * @param options JWS Verify options.
43
34
  */
44
- export declare function generalVerify(jws: types.GeneralJWSInput, key: types.KeyInput | GeneralVerifyGetKey, options?: types.VerifyOptions): Promise<types.GeneralVerifyResult & Partial<types.ResolvedKey>>;
35
+ export declare function generalVerify(jws: t.GeneralJWSInput, key: t.KeyInput | GeneralVerifyGetKey, options?: t.VerifyOptions): Promise<t.GeneralVerifyResult & Partial<t.ResolvedKey>>;
@@ -1,41 +1,31 @@
1
- import type * as types from '../types.d.ts';
2
- /** Combination of JWE Decryption options and JWT Claims Set verification options. */
3
- export interface JWTDecryptOptions extends types.DecryptOptions, types.JWTClaimVerificationOptions {
1
+ import type * as t from '../types.d.ts';
2
+ /** JWE decryption and JWT Claims Set validation options. */
3
+ export interface JWTDecryptOptions extends t.DecryptOptions, t.JWTClaimVerificationOptions {
4
4
  }
5
- /**
6
- * Interface for JWT Decryption dynamic key resolution. No token components have been verified at
7
- * the time of this function call.
8
- */
9
- export interface JWTDecryptGetKey<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array> extends types.GetKeyFunction<types.CompactJWEHeaderParameters, types.FlattenedJWE, KeyType | types.KeyObject | types.JWK> {
5
+ /** Dynamic key resolver for JWT decryption. */
6
+ export interface JWTDecryptGetKey<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array> extends t.GetKeyFunction<t.CompactJWEHeaderParameters, t.FlattenedJWE, KeyType | t.KeyObject | t.JWK> {
10
7
  }
11
8
  /**
12
- * Verifies the JWT format (to be a JWE Compact format), decrypts the ciphertext, validates the JWT
13
- * Claims Set.
9
+ * Decrypts a Compact JWE-formatted JWT and validates its Claims Set.
14
10
  *
15
- * @param jwt JSON Web Token value (encoded as JWE).
16
11
  * @param key Private Key or Secret to decrypt and verify the JWT with. See
17
12
  * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
18
- * @param options JWT Decryption and JWT Claims Set validation options.
19
13
  */
20
- export declare function jwtDecrypt<PayloadType = types.JWTPayload>(jwt: string | Uint8Array, key: types.KeyInput, options?: JWTDecryptOptions): Promise<types.JWTDecryptResult<PayloadType>>;
14
+ export declare function jwtDecrypt<PayloadType = t.JWTPayload>(jwt: string | Uint8Array, key: t.KeyInput, options?: JWTDecryptOptions): Promise<t.JWTDecryptResult<PayloadType>>;
21
15
  /**
22
16
  * Decrypts a JWT and validates its JWT Claims Set, resolving the key dynamically. The result
23
- * additionally carries the {@link types.ResolvedKey.key resolved key}.
17
+ * additionally carries the {@link t.ResolvedKey.key resolved key}.
24
18
  *
25
- * @param jwt JSON Web Token value (encoded as JWE).
26
19
  * @param getKey Function resolving Private Key or Secret to decrypt and verify the JWT with. See
27
20
  * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
28
- * @param options JWT Decryption and JWT Claims Set validation options.
29
21
  */
30
- export declare function jwtDecrypt<PayloadType = types.JWTPayload, KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array>(jwt: string | Uint8Array, getKey: JWTDecryptGetKey<KeyType>, options?: JWTDecryptOptions): Promise<types.JWTDecryptResult<PayloadType> & types.ResolvedKey<KeyType>>;
22
+ export declare function jwtDecrypt<PayloadType = t.JWTPayload, KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array>(jwt: string | Uint8Array, getKey: JWTDecryptGetKey<KeyType>, options?: JWTDecryptOptions): Promise<t.JWTDecryptResult<PayloadType> & t.ResolvedKey<KeyType>>;
31
23
  /**
32
24
  * Accepts either form of the `key` argument. Use this overload when forwarding a value that may be
33
25
  * either a key or a key resolution function; `key` is present on the result only when a resolution
34
26
  * function was used.
35
27
  *
36
- * @param jwt JSON Web Token value (encoded as JWE).
37
28
  * @param key Private Key or Secret, or a function resolving one, to decrypt and verify the JWT
38
29
  * with. See {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
39
- * @param options JWT Decryption and JWT Claims Set validation options.
40
30
  */
41
- export declare function jwtDecrypt<PayloadType = types.JWTPayload>(jwt: string | Uint8Array, key: types.KeyInput | JWTDecryptGetKey, options?: JWTDecryptOptions): Promise<types.JWTDecryptResult<PayloadType> & Partial<types.ResolvedKey>>;
31
+ export declare function jwtDecrypt<PayloadType = t.JWTPayload>(jwt: string | Uint8Array, key: t.KeyInput | JWTDecryptGetKey, options?: JWTDecryptOptions): Promise<t.JWTDecryptResult<PayloadType> & Partial<t.ResolvedKey>>;
@@ -1,11 +1,11 @@
1
- import type * as types from '../types.d.ts';
1
+ import type * as t from '../types.d.ts';
2
2
  /**
3
3
  * EncryptJWT constructor
4
4
  *
5
5
  * @param payload The JWT Claims Set object. Defaults to an empty object.
6
6
  */
7
- declare const EncryptJWT_base: new (payload?: types.JWTPayload) => types.ProduceJWT;
8
- /** The EncryptJWT class is used to build and encrypt Compact JWE formatted JSON Web Tokens. */
7
+ declare const EncryptJWT_base: new (payload?: t.JWTPayload) => t.ProduceJWT;
8
+ /** Builds and encrypts Compact JWE-formatted JSON Web Tokens. */
9
9
  export declare class EncryptJWT extends EncryptJWT_base {
10
10
  #private;
11
11
  /**
@@ -14,24 +14,20 @@ export declare class EncryptJWT extends EncryptJWT_base {
14
14
  * @param protectedHeader JWE Protected Header. Must contain an "alg" (JWE Algorithm) and "enc"
15
15
  * (JWE Encryption Algorithm) properties.
16
16
  */
17
- setProtectedHeader(protectedHeader: types.CompactJWEHeaderParameters): this;
17
+ setProtectedHeader(protectedHeader: t.CompactJWEHeaderParameters): this;
18
18
  /**
19
19
  * Sets the JWE Key Management parameters to be used when encrypting. Use this method instead of
20
20
  * the header setters to configure algorithm inputs such as ECDH-ES "apu" (Agreement PartyUInfo)
21
21
  * and "apv" (Agreement PartyVInfo), or PBES2 "p2c" (PBES2 Count). The parameters are added to the
22
22
  * appropriate JOSE Header.
23
- *
24
- * @param parameters JWE Key Management parameters.
25
23
  */
26
- setKeyManagementParameters(parameters: types.JWEKeyManagementHeaderParameters): this;
24
+ setKeyManagementParameters(parameters: t.JWEKeyManagementHeaderParameters): this;
27
25
  /**
28
26
  * Sets a content encryption key to use, by default a random suitable one is generated for the JWE
29
27
  * "enc" (Encryption Algorithm) Header Parameter.
30
28
  *
31
29
  * @deprecated You should not use this method. It is only really intended for test and vector
32
30
  * validation purposes.
33
- *
34
- * @param cek JWE Content Encryption Key.
35
31
  */
36
32
  setContentEncryptionKey(cek: Uint8Array): this;
37
33
  /**
@@ -40,8 +36,6 @@ export declare class EncryptJWT extends EncryptJWT_base {
40
36
  *
41
37
  * @deprecated You should not use this method. It is only really intended for test and vector
42
38
  * validation purposes.
43
- *
44
- * @param iv JWE Initialization Vector.
45
39
  */
46
40
  setInitializationVector(iv: Uint8Array): this;
47
41
  /** Replicates the "iss" (Issuer) Claim as a JWE Protected Header Parameter. */
@@ -55,8 +49,7 @@ export declare class EncryptJWT extends EncryptJWT_base {
55
49
  *
56
50
  * @param key Public Key or Secret to encrypt the JWT with. See
57
51
  * {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}.
58
- * @param options JWE Encryption options.
59
52
  */
60
- encrypt(key: types.KeyInput, options?: types.EncryptOptions): Promise<string>;
53
+ encrypt(key: t.KeyInput, options?: t.EncryptOptions): Promise<string>;
61
54
  }
62
55
  export {};
@@ -1,11 +1,11 @@
1
- import type * as types from '../types.d.ts';
1
+ import type * as t from '../types.d.ts';
2
2
  /**
3
3
  * SignJWT constructor
4
4
  *
5
5
  * @param payload The JWT Claims Set object. Defaults to an empty object.
6
6
  */
7
- declare const SignJWT_base: new (payload?: types.JWTPayload) => types.ProduceJWT;
8
- /** The SignJWT class is used to build and sign Compact JWS formatted JSON Web Tokens. */
7
+ declare const SignJWT_base: new (payload?: t.JWTPayload) => t.ProduceJWT;
8
+ /** Builds and signs Compact JWS-formatted JSON Web Tokens. */
9
9
  export declare class SignJWT extends SignJWT_base {
10
10
  #private;
11
11
  /**
@@ -13,14 +13,13 @@ export declare class SignJWT extends SignJWT_base {
13
13
  *
14
14
  * @param protectedHeader JWS Protected Header. Must contain an "alg" (JWS Algorithm) property.
15
15
  */
16
- setProtectedHeader(protectedHeader: types.JWTHeaderParameters): this;
16
+ setProtectedHeader(protectedHeader: t.JWTHeaderParameters): this;
17
17
  /**
18
18
  * Signs and returns the JWT.
19
19
  *
20
20
  * @param key Private Key or Secret to sign the JWT with. See
21
21
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
22
- * @param options JWT Sign options.
23
22
  */
24
- sign(key: types.KeyInput, options?: types.SignOptions): Promise<string>;
23
+ sign(key: t.KeyInput, options?: t.SignOptions): Promise<string>;
25
24
  }
26
25
  export {};
@@ -1,28 +1,23 @@
1
- import type * as types from '../types.d.ts';
2
- /** Result of decoding an Unsecured JWT. */
3
- export interface UnsecuredResult<PayloadType = types.JWTPayload> {
1
+ import type * as t from '../types.d.ts';
2
+ /** Decoded Unsecured JWT. */
3
+ export interface UnsecuredResult<PayloadType = t.JWTPayload> {
4
4
  /** JWT Claims Set. */
5
- payload: PayloadType & types.JWTPayload & ([PayloadType] extends [object] ? unknown : unknown extends PayloadType ? unknown : never);
5
+ payload: PayloadType & t.JWTPayload & ([PayloadType] extends [object] ? unknown : unknown extends PayloadType ? unknown : never);
6
6
  /** The decoded JOSE Header; always `{ "alg": "none" }` for an Unsecured JWT. */
7
- header: types.JWSHeaderParameters;
7
+ header: t.JWSHeaderParameters;
8
8
  }
9
9
  /**
10
10
  * UnsecuredJWT constructor
11
11
  *
12
12
  * @param payload The JWT Claims Set object. Defaults to an empty object.
13
13
  */
14
- declare const UnsecuredJWT_base: new (payload?: types.JWTPayload) => types.ProduceJWT;
15
- /** The UnsecuredJWT class is a utility for dealing with `{ "alg": "none" }` Unsecured JWTs. */
14
+ declare const UnsecuredJWT_base: new (payload?: t.JWTPayload) => t.ProduceJWT;
15
+ /** Encodes and decodes `{ "alg": "none" }` Unsecured JWTs. */
16
16
  export declare class UnsecuredJWT extends UnsecuredJWT_base {
17
17
  private jwt;
18
18
  /** Encodes the Unsecured JWT. */
19
19
  encode(): string;
20
- /**
21
- * Decodes an unsecured JWT.
22
- *
23
- * @param jwt Unsecured JWT to decode the payload of.
24
- * @param options JWT Claims Set validation options.
25
- */
26
- static decode<PayloadType = types.JWTPayload>(jwt: string, options?: types.JWTClaimVerificationOptions): UnsecuredResult<PayloadType>;
20
+ /** Decodes an unsecured JWT. */
21
+ static decode<PayloadType = t.JWTPayload>(jwt: string, options?: t.JWTClaimVerificationOptions): UnsecuredResult<PayloadType>;
27
22
  }
28
23
  export {};
@@ -1,38 +1,28 @@
1
- import type * as types from '../types.d.ts';
2
- /** Combination of JWS Verification options and JWT Claims Set verification options. */
3
- export interface JWTVerifyOptions extends types.VerifyOptions, types.JWTClaimVerificationOptions {
1
+ import type * as t from '../types.d.ts';
2
+ /** JWS verification and JWT Claims Set validation options. */
3
+ export interface JWTVerifyOptions extends t.VerifyOptions, t.JWTClaimVerificationOptions {
4
4
  }
5
- /**
6
- * Interface for JWT Verification dynamic key resolution. No token components have been verified at
7
- * the time of this function call.
8
- */
9
- export interface JWTVerifyGetKey<KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array> extends types.GetKeyFunction<types.CompactJWSHeaderParameters, types.FlattenedJWSInput, KeyType | types.KeyObject | types.JWK> {
5
+ /** Dynamic key resolver for JWT verification. */
6
+ export interface JWTVerifyGetKey<KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array> extends t.GetKeyFunction<t.CompactJWSHeaderParameters, t.FlattenedJWSInput, KeyType | t.KeyObject | t.JWK> {
10
7
  }
11
8
  /**
12
- * Verifies the JWT format (to be a JWS Compact format), verifies the JWS signature, validates the
13
- * JWT Claims Set.
9
+ * Verifies a Compact JWS-formatted JWT and validates its Claims Set.
14
10
  *
15
- * @param jwt JSON Web Token value (encoded as JWS).
16
11
  * @param key Key to verify the JWT with. See
17
12
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
18
- * @param options JWT Decryption and JWT Claims Set validation options.
19
13
  */
20
- export declare function jwtVerify<PayloadType = types.JWTPayload>(jwt: string | Uint8Array, key: types.KeyInput, options?: JWTVerifyOptions): Promise<types.JWTVerifyResult<PayloadType>>;
14
+ export declare function jwtVerify<PayloadType = t.JWTPayload>(jwt: string | Uint8Array, key: t.KeyInput, options?: JWTVerifyOptions): Promise<t.JWTVerifyResult<PayloadType>>;
21
15
  /**
22
- * @param jwt JSON Web Token value (encoded as JWS).
23
16
  * @param getKey Function resolving a key to verify the JWT with. See
24
17
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
25
- * @param options JWT Decryption and JWT Claims Set validation options.
26
18
  */
27
- export declare function jwtVerify<PayloadType = types.JWTPayload, KeyType extends types.CryptoKey | Uint8Array = types.CryptoKey | Uint8Array>(jwt: string | Uint8Array, getKey: JWTVerifyGetKey<KeyType>, options?: JWTVerifyOptions): Promise<types.JWTVerifyResult<PayloadType> & types.ResolvedKey<KeyType>>;
19
+ export declare function jwtVerify<PayloadType = t.JWTPayload, KeyType extends t.CryptoKey | Uint8Array = t.CryptoKey | Uint8Array>(jwt: string | Uint8Array, getKey: JWTVerifyGetKey<KeyType>, options?: JWTVerifyOptions): Promise<t.JWTVerifyResult<PayloadType> & t.ResolvedKey<KeyType>>;
28
20
  /**
29
21
  * Accepts either form of the `key` argument. Use this overload when forwarding a value that may be
30
22
  * either a key or a key resolution function; `key` is present on the result only when a resolution
31
23
  * function was used.
32
24
  *
33
- * @param jwt JSON Web Token value (encoded as JWS).
34
25
  * @param key Key, or function resolving a key, to verify the JWT with. See
35
26
  * {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}.
36
- * @param options JWT Decryption and JWT Claims Set validation options.
37
27
  */
38
- export declare function jwtVerify<PayloadType = types.JWTPayload>(jwt: string | Uint8Array, key: types.KeyInput | JWTVerifyGetKey, options?: JWTVerifyOptions): Promise<types.JWTVerifyResult<PayloadType> & Partial<types.ResolvedKey>>;
28
+ export declare function jwtVerify<PayloadType = t.JWTPayload>(jwt: string | Uint8Array, key: t.KeyInput | JWTVerifyGetKey, options?: JWTVerifyOptions): Promise<t.JWTVerifyResult<PayloadType> & Partial<t.ResolvedKey>>;
@@ -1,19 +1,19 @@
1
- import type * as types from '../types.d.ts';
1
+ import type * as t from '../types.d.ts';
2
2
  /**
3
3
  * Exports a public {@link !CryptoKey} or {@link !KeyObject} to a PEM-encoded SPKI string format.
4
4
  *
5
5
  * @param key Key to export to a PEM-encoded SPKI string format.
6
6
  */
7
- export declare function exportSPKI(key: types.CryptoKey | types.KeyObject): Promise<string>;
7
+ export declare function exportSPKI(key: t.CryptoKey | t.KeyObject): Promise<string>;
8
8
  /**
9
9
  * Exports a private {@link !CryptoKey} or {@link !KeyObject} to a PEM-encoded PKCS8 string format.
10
10
  *
11
11
  * @param key Key to export to a PEM-encoded PKCS8 string format.
12
12
  */
13
- export declare function exportPKCS8(key: types.CryptoKey | types.KeyObject): Promise<string>;
13
+ export declare function exportPKCS8(key: t.CryptoKey | t.KeyObject): Promise<string>;
14
14
  /**
15
15
  * Exports a {@link !CryptoKey}, {@link !KeyObject}, or {@link !Uint8Array} to a JWK.
16
16
  *
17
17
  * @param key Key to export as JWK.
18
18
  */
19
- export declare function exportJWK(key: types.CryptoKey | types.KeyObject | Uint8Array): Promise<types.JWK>;
19
+ export declare function exportJWK(key: t.CryptoKey | t.KeyObject | Uint8Array): Promise<t.JWK>;
@@ -1,17 +1,17 @@
1
- import type * as types from '../types.d.ts';
1
+ import type * as t from '../types.d.ts';
2
2
  /**
3
3
  * JWA Algorithm Identifiers that {@link generateKeyPair} is able to generate a key pair for, subject
4
4
  * to runtime support.
5
5
  */
6
6
  export type GenerateKeyPairAlgorithm = 'PS256' | 'PS384' | 'PS512' | 'RS256' | 'RS384' | 'RS512' | 'RSA-OAEP' | 'RSA-OAEP-256' | 'RSA-OAEP-384' | 'RSA-OAEP-512' | 'ES256' | 'ES384' | 'ES512' | 'Ed25519' | 'EdDSA' | 'ML-DSA-44' | 'ML-DSA-65' | 'ML-DSA-87' | 'ECDH-ES' | 'ECDH-ES+A128KW' | 'ECDH-ES+A192KW' | 'ECDH-ES+A256KW' | (string & {});
7
- /** Asymmetric key pair generation function result. */
7
+ /** Generated asymmetric key pair. */
8
8
  export interface GenerateKeyPairResult {
9
9
  /** The generated Private Key. */
10
- privateKey: types.CryptoKey;
10
+ privateKey: t.CryptoKey;
11
11
  /** Public Key corresponding to the generated Private Key. */
12
- publicKey: types.CryptoKey;
12
+ publicKey: t.CryptoKey;
13
13
  }
14
- /** Asymmetric key pair generation function options. */
14
+ /** Asymmetric key pair generation options. */
15
15
  export interface GenerateKeyPairOptions {
16
16
  /**
17
17
  * The EC "crv" (Curve) or OKP "crv" (Subtype of Key Pair) value to generate. The curve must be
@@ -27,14 +27,12 @@ export interface GenerateKeyPairOptions {
27
27
  extractable?: boolean;
28
28
  }
29
29
  /**
30
- * Generates a private and a public key for a given JWA algorithm identifier. This can only generate
31
- * asymmetric key pairs. For symmetric secrets use the `generateSecret` function.
30
+ * Generates an asymmetric key pair for a JWA algorithm identifier.
32
31
  *
33
32
  * > Note: The `privateKey` is generated with `extractable` set to `false` by default. See
34
33
  * > {@link GenerateKeyPairOptions.extractable} to generate an extractable `privateKey`.
35
34
  *
36
35
  * @param alg JWA Algorithm Identifier to be used with the generated key pair. See
37
36
  * {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}.
38
- * @param options Additional options passed down to the key pair generation.
39
37
  */
40
38
  export declare function generateKeyPair(alg: GenerateKeyPairAlgorithm, options?: GenerateKeyPairOptions): Promise<GenerateKeyPairResult>;
@@ -1,18 +1,12 @@
1
- import type * as types from '../types.d.ts';
1
+ import type * as t from '../types.d.ts';
2
2
  /**
3
3
  * JWA Algorithm Identifiers that {@link generateSecret} is able to generate a secret for, subject to
4
4
  * runtime support.
5
5
  */
6
6
  export type GenerateSecretAlgorithm = 'HS256' | 'HS384' | 'HS512' | 'A128CBC-HS256' | 'A192CBC-HS384' | 'A256CBC-HS512' | 'A128KW' | 'A192KW' | 'A256KW' | 'A128GCMKW' | 'A192GCMKW' | 'A256GCMKW' | 'A128GCM' | 'A192GCM' | 'A256GCM' | (string & {});
7
- /**
8
- * Resolves what {@link generateSecret} returns for a given JWA Algorithm Identifier. The
9
- * AES_CBC_HMAC_SHA2 content encryption algorithms have no {@link !CryptoKey} representation, so they
10
- * yield a {@link !Uint8Array}; every other supported identifier yields a
11
- * {@link types.CryptoKey CryptoKey}. When the identifier is not statically known this resolves to
12
- * their union.
13
- */
14
- export type GeneratedSecret<Alg extends string> = Alg extends 'A128CBC-HS256' | 'A192CBC-HS384' | 'A256CBC-HS512' ? Uint8Array : string extends Alg ? types.CryptoKey | Uint8Array : types.CryptoKey;
15
- /** Secret generation function options. */
7
+ /** Maps a JWA algorithm identifier to the value returned by {@link generateSecret}. */
8
+ export type GeneratedSecret<Alg extends string> = Alg extends 'A128CBC-HS256' | 'A192CBC-HS384' | 'A256CBC-HS512' ? Uint8Array : string extends Alg ? t.CryptoKey | Uint8Array : t.CryptoKey;
9
+ /** Secret generation options. */
16
10
  export interface GenerateSecretOptions {
17
11
  /**
18
12
  * The value to use as {@link !SubtleCrypto.generateKey} `extractable` argument. Default is false.
@@ -32,6 +26,5 @@ export interface GenerateSecretOptions {
32
26
  *
33
27
  * @param alg JWA Algorithm Identifier to be used with the generated secret. See
34
28
  * {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}.
35
- * @param options Additional options passed down to the secret generation.
36
29
  */
37
30
  export declare function generateSecret<Alg extends GenerateSecretAlgorithm>(alg: Alg, options?: GenerateSecretOptions): Promise<GeneratedSecret<Alg>>;