jose 4.8.3 → 4.9.2

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 (50) hide show
  1. package/README.md +6 -3
  2. package/dist/browser/index.js +1 -1
  3. package/dist/browser/jwe/flattened/decrypt.js +3 -3
  4. package/dist/browser/jwk/thumbprint.js +7 -1
  5. package/dist/browser/jws/flattened/verify.js +1 -1
  6. package/dist/browser/lib/decrypt_key_management.js +4 -1
  7. package/dist/node/cjs/index.js +2 -1
  8. package/dist/node/cjs/jwe/flattened/decrypt.js +3 -3
  9. package/dist/node/cjs/jwk/thumbprint.js +9 -2
  10. package/dist/node/cjs/jws/flattened/verify.js +1 -1
  11. package/dist/node/cjs/lib/decrypt_key_management.js +4 -1
  12. package/dist/node/cjs/runtime/key_to_jwk.js +4 -0
  13. package/dist/node/esm/index.js +1 -1
  14. package/dist/node/esm/jwe/flattened/decrypt.js +3 -3
  15. package/dist/node/esm/jwk/thumbprint.js +7 -1
  16. package/dist/node/esm/jws/flattened/verify.js +1 -1
  17. package/dist/node/esm/lib/decrypt_key_management.js +4 -1
  18. package/dist/node/esm/runtime/key_to_jwk.js +4 -0
  19. package/dist/types/index.d.ts +1 -1
  20. package/dist/types/jwe/compact/decrypt.d.ts +9 -7
  21. package/dist/types/jwe/compact/encrypt.d.ts +14 -20
  22. package/dist/types/jwe/flattened/decrypt.d.ts +12 -13
  23. package/dist/types/jwe/flattened/encrypt.d.ts +17 -26
  24. package/dist/types/jwe/general/decrypt.d.ts +13 -14
  25. package/dist/types/jwe/general/encrypt.d.ts +6 -15
  26. package/dist/types/jwk/embedded.d.ts +8 -7
  27. package/dist/types/jwk/thumbprint.d.ts +30 -7
  28. package/dist/types/jwks/local.d.ts +12 -15
  29. package/dist/types/jwks/remote.d.ts +22 -36
  30. package/dist/types/jws/compact/sign.d.ts +3 -6
  31. package/dist/types/jws/compact/verify.d.ts +11 -8
  32. package/dist/types/jws/flattened/sign.d.ts +3 -6
  33. package/dist/types/jws/flattened/verify.d.ts +12 -9
  34. package/dist/types/jws/general/sign.d.ts +7 -18
  35. package/dist/types/jws/general/verify.d.ts +14 -11
  36. package/dist/types/jwt/decrypt.d.ts +13 -12
  37. package/dist/types/jwt/encrypt.d.ts +15 -18
  38. package/dist/types/jwt/produce.d.ts +9 -14
  39. package/dist/types/jwt/sign.d.ts +2 -2
  40. package/dist/types/jwt/unsecured.d.ts +4 -4
  41. package/dist/types/jwt/verify.d.ts +15 -13
  42. package/dist/types/key/export.d.ts +13 -8
  43. package/dist/types/key/generate_key_pair.d.ts +14 -19
  44. package/dist/types/key/generate_secret.d.ts +3 -2
  45. package/dist/types/key/import.d.ts +50 -39
  46. package/dist/types/types.d.ts +203 -371
  47. package/dist/types/util/decode_jwt.d.ts +7 -6
  48. package/dist/types/util/decode_protected_header.d.ts +3 -2
  49. package/dist/types/util/errors.d.ts +20 -61
  50. package/package.json +4 -2
@@ -1,12 +1,8 @@
1
1
  import type { JWTPayload } from '../types';
2
- /**
3
- * Generic class for JWT producing.
4
- */
2
+ /** Generic class for JWT producing. */
5
3
  export declare class ProduceJWT {
6
4
  protected _payload: JWTPayload;
7
- /**
8
- * @param payload The JWT Claims Set object.
9
- */
5
+ /** @param payload The JWT Claims Set object. */
10
6
  constructor(payload: JWTPayload);
11
7
  /**
12
8
  * Set "iss" (Issuer) Claim.
@@ -35,24 +31,23 @@ export declare class ProduceJWT {
35
31
  /**
36
32
  * Set "nbf" (Not Before) Claim.
37
33
  *
38
- * @param input "nbf" (Not Before) Claim value to set on the JWT Claims Set.
39
- * When number is passed that is used as a value, when string is passed
40
- * it is resolved to a time span and added to the current timestamp.
34
+ * @param input "nbf" (Not Before) Claim value to set on the JWT Claims Set. When number is passed
35
+ * that is used as a value, when string is passed it is resolved to a time span and added to the
36
+ * current timestamp.
41
37
  */
42
38
  setNotBefore(input: number | string): this;
43
39
  /**
44
40
  * Set "exp" (Expiration Time) Claim.
45
41
  *
46
- * @param input "exp" (Expiration Time) Claim value to set on the JWT Claims Set.
47
- * When number is passed that is used as a value, when string is passed
48
- * it is resolved to a time span and added to the current timestamp.
42
+ * @param input "exp" (Expiration Time) Claim value to set on the JWT Claims Set. When number is
43
+ * passed that is used as a value, when string is passed it is resolved to a time span and added
44
+ * to the current timestamp.
49
45
  */
50
46
  setExpirationTime(input: number | string): this;
51
47
  /**
52
48
  * Set "iat" (Issued At) Claim.
53
49
  *
54
- * @param input "iat" (Issued At) Claim value to set on the JWT Claims Set.
55
- * Default is current timestamp.
50
+ * @param input "iat" (Issued At) Claim value to set on the JWT Claims Set. Default is current timestamp.
56
51
  */
57
52
  setIssuedAt(input?: number): this;
58
53
  }
@@ -4,6 +4,7 @@ import { ProduceJWT } from './produce';
4
4
  * The SignJWT class is a utility for creating Compact JWS formatted JWT strings.
5
5
  *
6
6
  * @example Usage
7
+ *
7
8
  * ```js
8
9
  * const jwt = await new jose.SignJWT({ 'urn:example:claim': true })
9
10
  * .setProtectedHeader({ alg: 'ES256' })
@@ -21,8 +22,7 @@ export declare class SignJWT extends ProduceJWT {
21
22
  /**
22
23
  * Sets the JWS Protected Header on the SignJWT object.
23
24
  *
24
- * @param protectedHeader JWS Protected Header.
25
- * Must contain an "alg" (JWS Algorithm) property.
25
+ * @param protectedHeader JWS Protected Header. Must contain an "alg" (JWS Algorithm) property.
26
26
  */
27
27
  setProtectedHeader(protectedHeader: JWTHeaderParameters): this;
28
28
  /**
@@ -8,6 +8,7 @@ export interface UnsecuredResult {
8
8
  * The UnsecuredJWT class is a utility for dealing with `{ "alg": "none" }` Unsecured JWTs.
9
9
  *
10
10
  * @example Encoding
11
+ *
11
12
  * ```js
12
13
  * const unsecuredJwt = new jose.UnsecuredJWT({ 'urn:example:claim': true })
13
14
  * .setIssuedAt()
@@ -20,19 +21,18 @@ export interface UnsecuredResult {
20
21
  * ```
21
22
  *
22
23
  * @example Decoding
24
+ *
23
25
  * ```js
24
26
  * const payload = jose.UnsecuredJWT.decode(jwt, {
25
27
  * issuer: 'urn:example:issuer',
26
- * audience: 'urn:example:audience'
28
+ * audience: 'urn:example:audience',
27
29
  * })
28
30
  *
29
31
  * console.log(payload)
30
32
  * ```
31
33
  */
32
34
  export declare class UnsecuredJWT extends ProduceJWT {
33
- /**
34
- * Encodes the Unsecured JWT.
35
- */
35
+ /** Encodes the Unsecured JWT. */
36
36
  encode(): string;
37
37
  /**
38
38
  * Decodes an unsecured JWT.
@@ -1,37 +1,39 @@
1
1
  import type { KeyLike, VerifyOptions, JWTClaimVerificationOptions, JWTHeaderParameters, GetKeyFunction, FlattenedJWSInput, JWTVerifyResult, ResolvedKey } from '../types';
2
- /**
3
- * Combination of JWS Verification options and JWT Claims Set verification options.
4
- */
2
+ /** Combination of JWS Verification options and JWT Claims Set verification options. */
5
3
  export interface JWTVerifyOptions extends VerifyOptions, JWTClaimVerificationOptions {
6
4
  }
7
5
  /**
8
- * Interface for JWT Verification dynamic key resolution.
9
- * No token components have been verified at the time of this function call.
6
+ * Interface for JWT Verification dynamic key resolution. No token components have been verified at
7
+ * the time of this function call.
10
8
  *
11
- * See [createRemoteJWKSet](../functions/jwks_remote.createRemoteJWKSet.md#function-createremotejwkset)
9
+ * See
10
+ * [createRemoteJWKSet](../functions/jwks_remote.createRemoteJWKSet.md#function-createremotejwkset)
12
11
  * to verify using a remote JSON Web Key Set.
13
12
  */
14
13
  export interface JWTVerifyGetKey extends GetKeyFunction<JWTHeaderParameters, FlattenedJWSInput> {
15
14
  }
16
15
  /**
17
- * Verifies the JWT format (to be a JWS Compact format), verifies the JWS signature, validates the JWT Claims Set.
18
- *
19
- * @param jwt JSON Web Token value (encoded as JWS).
20
- * @param key Key to verify the JWT with.
21
- * @param options JWT Decryption and JWT Claims Set validation options.
16
+ * Verifies the JWT format (to be a JWS Compact format), verifies the JWS signature, validates the
17
+ * JWT Claims Set.
22
18
  *
23
19
  * @example Usage
20
+ *
24
21
  * ```js
25
- * const jwt = 'eyJhbGciOiJFUzI1NiJ9.eyJ1cm46ZXhhbXBsZTpjbGFpbSI6dHJ1ZSwiaWF0IjoxNjA0MzE1MDc0LCJpc3MiOiJ1cm46ZXhhbXBsZTppc3N1ZXIiLCJhdWQiOiJ1cm46ZXhhbXBsZTphdWRpZW5jZSJ9.hx1nOfAT5LlXuzu8O-bhjXBGpklWDt2EsHw7-MDn49NrnwvVsstNhEnkW2ddauB7eSikFtUNeumLpFI9CWDBsg'
22
+ * const jwt =
23
+ * 'eyJhbGciOiJFUzI1NiJ9.eyJ1cm46ZXhhbXBsZTpjbGFpbSI6dHJ1ZSwiaWF0IjoxNjA0MzE1MDc0LCJpc3MiOiJ1cm46ZXhhbXBsZTppc3N1ZXIiLCJhdWQiOiJ1cm46ZXhhbXBsZTphdWRpZW5jZSJ9.hx1nOfAT5LlXuzu8O-bhjXBGpklWDt2EsHw7-MDn49NrnwvVsstNhEnkW2ddauB7eSikFtUNeumLpFI9CWDBsg'
26
24
  *
27
25
  * const { payload, protectedHeader } = await jose.jwtVerify(jwt, publicKey, {
28
26
  * issuer: 'urn:example:issuer',
29
- * audience: 'urn:example:audience'
27
+ * audience: 'urn:example:audience',
30
28
  * })
31
29
  *
32
30
  * console.log(protectedHeader)
33
31
  * console.log(payload)
34
32
  * ```
33
+ *
34
+ * @param jwt JSON Web Token value (encoded as JWS).
35
+ * @param key Key to verify the JWT with.
36
+ * @param options JWT Decryption and JWT Claims Set validation options.
35
37
  */
36
38
  export declare function jwtVerify(jwt: string | Uint8Array, key: KeyLike | Uint8Array, options?: JWTVerifyOptions): Promise<JWTVerifyResult>;
37
39
  /**
@@ -1,36 +1,39 @@
1
1
  import type { JWK, KeyLike } from '../types';
2
2
  /**
3
- * Exports a runtime-specific public key representation (KeyObject or CryptoKey) to a PEM-encoded SPKI string format.
4
- *
5
- * @param key Key representation to transform to a PEM-encoded SPKI string format.
3
+ * Exports a runtime-specific public key representation (KeyObject or CryptoKey) to a PEM-encoded
4
+ * SPKI string format.
6
5
  *
7
6
  * @example Usage
7
+ *
8
8
  * ```js
9
9
  * const spkiPem = await jose.exportSPKI(publicKey)
10
10
  *
11
11
  * console.log(spkiPem)
12
12
  * ```
13
+ *
14
+ * @param key Key representation to transform to a PEM-encoded SPKI string format.
13
15
  */
14
16
  export declare function exportSPKI(key: KeyLike): Promise<string>;
15
17
  /**
16
- * Exports a runtime-specific private key representation (KeyObject or CryptoKey) to a PEM-encoded PKCS8 string format.
17
- *
18
- * @param key Key representation to transform to a PEM-encoded PKCS8 string format.
18
+ * Exports a runtime-specific private key representation (KeyObject or CryptoKey) to a PEM-encoded
19
+ * PKCS8 string format.
19
20
  *
20
21
  * @example Usage
22
+ *
21
23
  * ```js
22
24
  * const pkcs8Pem = await jose.exportPKCS8(privateKey)
23
25
  *
24
26
  * console.log(pkcs8Pem)
25
27
  * ```
28
+ *
29
+ * @param key Key representation to transform to a PEM-encoded PKCS8 string format.
26
30
  */
27
31
  export declare function exportPKCS8(key: KeyLike): Promise<string>;
28
32
  /**
29
33
  * Exports a runtime-specific key representation (KeyLike) to a JWK.
30
34
  *
31
- * @param key Key representation to export as JWK.
32
- *
33
35
  * @example Usage
36
+ *
34
37
  * ```js
35
38
  * const privateJwk = await jose.exportJWK(privateKey)
36
39
  * const publicJwk = await jose.exportJWK(publicKey)
@@ -38,5 +41,7 @@ export declare function exportPKCS8(key: KeyLike): Promise<string>;
38
41
  * console.log(privateJwk)
39
42
  * console.log(publicJwk)
40
43
  * ```
44
+ *
45
+ * @param key Key representation to export as JWK.
41
46
  */
42
47
  export declare function exportJWK(key: KeyLike | Uint8Array): Promise<JWK>;
@@ -1,24 +1,19 @@
1
1
  import type { KeyLike } from '../types';
2
2
  export interface GenerateKeyPairResult {
3
- /**
4
- * The generated Private Key.
5
- */
3
+ /** The generated Private Key. */
6
4
  privateKey: KeyLike;
7
- /**
8
- * Public Key corresponding to the generated Private Key.
9
- */
5
+ /** Public Key corresponding to the generated Private Key. */
10
6
  publicKey: KeyLike;
11
7
  }
12
8
  export interface GenerateKeyPairOptions {
13
9
  /**
14
- * The EC "crv" (Curve) or OKP "crv" (Subtype of Key Pair) value to generate.
15
- * The curve must be both supported on the runtime as well as applicable for
16
- * the given JWA algorithm identifier.
10
+ * The EC "crv" (Curve) or OKP "crv" (Subtype of Key Pair) value to generate. The curve must be
11
+ * both supported on the runtime as well as applicable for the given JWA algorithm identifier.
17
12
  */
18
13
  crv?: string;
19
14
  /**
20
- * A hint for RSA algorithms to generate an RSA key of a given `modulusLength`
21
- * (Key size in bits). JOSE requires 2048 bits or larger. Default is 2048.
15
+ * A hint for RSA algorithms to generate an RSA key of a given `modulusLength` (Key size in bits).
16
+ * JOSE requires 2048 bits or larger. Default is 2048.
22
17
  */
23
18
  modulusLength?: number;
24
19
  /**
@@ -29,21 +24,21 @@ export interface GenerateKeyPairOptions {
29
24
  extractable?: boolean;
30
25
  }
31
26
  /**
32
- * Generates a private and a public key for a given JWA algorithm identifier.
33
- * This can only generate asymmetric key pairs. For symmetric secrets use the
34
- * `generateSecret` function.
27
+ * Generates a private and a public key for a given JWA algorithm identifier. This can only generate
28
+ * asymmetric key pairs. For symmetric secrets use the `generateSecret` function.
35
29
  *
36
- * Note: Under Web Cryptography API runtime the `privateKey` is generated with
37
- * `extractable` set to `false` by default.
38
- *
39
- * @param alg JWA Algorithm Identifier to be used with the generated key pair.
40
- * @param options Additional options passed down to the key pair generation.
30
+ * Note: Under Web Cryptography API runtime the `privateKey` is generated with `extractable` set to
31
+ * `false` by default.
41
32
  *
42
33
  * @example Usage
34
+ *
43
35
  * ```js
44
36
  * const { publicKey, privateKey } = await jose.generateKeyPair('PS256')
45
37
  * console.log(publicKey)
46
38
  * console.log(privateKey)
47
39
  * ```
40
+ *
41
+ * @param alg JWA Algorithm Identifier to be used with the generated key pair.
42
+ * @param options Additional options passed down to the key pair generation.
48
43
  */
49
44
  export declare function generateKeyPair(alg: string, options?: GenerateKeyPairOptions): Promise<GenerateKeyPairResult>;
@@ -10,10 +10,11 @@ export interface GenerateSecretOptions {
10
10
  /**
11
11
  * Generates a symmetric secret key for a given JWA algorithm identifier.
12
12
  *
13
- * Note: Under Web Cryptography API runtime the secret key is generated with
14
- * `extractable` set to `false` by default.
13
+ * Note: Under Web Cryptography API runtime the secret key is generated with `extractable` set to
14
+ * `false` by default.
15
15
  *
16
16
  * @example Usage
17
+ *
17
18
  * ```js
18
19
  * const secret = await jose.generateSecret('HS256')
19
20
  * console.log(secret)
@@ -8,14 +8,12 @@ export interface PEMImportOptions {
8
8
  extractable?: boolean;
9
9
  }
10
10
  /**
11
- * Imports a PEM-encoded SPKI string as a runtime-specific public key representation (KeyObject or CryptoKey).
12
- * See [Algorithm Key Requirements](https://github.com/panva/jose/issues/210) to learn about key to algorithm
13
- * requirements and mapping.
14
- *
15
- * @param pem PEM-encoded SPKI string
16
- * @param alg JSON Web Algorithm identifier to be used with the imported key.
11
+ * Imports a PEM-encoded SPKI string as a runtime-specific public key representation (KeyObject or
12
+ * CryptoKey). See [Algorithm Key Requirements](https://github.com/panva/jose/issues/210) to learn
13
+ * about key to algorithm requirements and mapping.
17
14
  *
18
15
  * @example Usage
16
+ *
19
17
  * ```js
20
18
  * const algorithm = 'ES256'
21
19
  * const spki = `-----BEGIN PUBLIC KEY-----
@@ -24,17 +22,19 @@ export interface PEMImportOptions {
24
22
  * -----END PUBLIC KEY-----`
25
23
  * const ecPublicKey = await jose.importSPKI(spki, algorithm)
26
24
  * ```
25
+ *
26
+ * @param pem PEM-encoded SPKI string
27
+ * @param alg JSON Web Algorithm identifier to be used with the imported key.
27
28
  */
28
29
  export declare function importSPKI(spki: string, alg: string, options?: PEMImportOptions): Promise<KeyLike>;
29
30
  /**
30
- * Imports the SPKI from an X.509 string certificate as a runtime-specific public key representation (KeyObject or CryptoKey).
31
- * See [Algorithm Key Requirements](https://github.com/panva/jose/issues/210) to learn about key to algorithm
31
+ * Imports the SPKI from an X.509 string certificate as a runtime-specific public key representation
32
+ * (KeyObject or CryptoKey). See [Algorithm Key
33
+ * Requirements](https://github.com/panva/jose/issues/210) to learn about key to algorithm
32
34
  * requirements and mapping.
33
35
  *
34
- * @param pem X.509 certificate string
35
- * @param alg JSON Web Algorithm identifier to be used with the imported key.
36
- *
37
36
  * @example Usage
37
+ *
38
38
  * ```js
39
39
  * const algorithm = 'ES256'
40
40
  * const x509 = `-----BEGIN CERTIFICATE-----
@@ -49,17 +49,18 @@ export declare function importSPKI(spki: string, alg: string, options?: PEMImpor
49
49
  * -----END CERTIFICATE-----`
50
50
  * const ecPublicKey = await jose.importX509(x509, algorithm)
51
51
  * ```
52
+ *
53
+ * @param pem X.509 certificate string
54
+ * @param alg JSON Web Algorithm identifier to be used with the imported key.
52
55
  */
53
56
  export declare function importX509(x509: string, alg: string, options?: PEMImportOptions): Promise<KeyLike>;
54
57
  /**
55
- * Imports a PEM-encoded PKCS8 string as a runtime-specific private key representation (KeyObject or CryptoKey).
56
- * See [Algorithm Key Requirements](https://github.com/panva/jose/issues/210) to learn about key to algorithm
57
- * requirements and mapping. Encrypted keys are not supported.
58
- *
59
- * @param pem PEM-encoded PKCS8 string
60
- * @param alg JSON Web Algorithm identifier to be used with the imported key.
58
+ * Imports a PEM-encoded PKCS8 string as a runtime-specific private key representation (KeyObject or
59
+ * CryptoKey). See [Algorithm Key Requirements](https://github.com/panva/jose/issues/210) to learn
60
+ * about key to algorithm requirements and mapping. Encrypted keys are not supported.
61
61
  *
62
62
  * @example Usage
63
+ *
63
64
  * ```js
64
65
  * const algorithm = 'ES256'
65
66
  * const pkcs8 = `-----BEGIN PRIVATE KEY-----
@@ -69,36 +70,46 @@ export declare function importX509(x509: string, alg: string, options?: PEMImpor
69
70
  * -----END PRIVATE KEY-----`
70
71
  * const ecPrivateKey = await jose.importPKCS8(pkcs8, algorithm)
71
72
  * ```
73
+ *
74
+ * @param pem PEM-encoded PKCS8 string
75
+ * @param alg JSON Web Algorithm identifier to be used with the imported key.
72
76
  */
73
77
  export declare function importPKCS8(pkcs8: string, alg: string, options?: PEMImportOptions): Promise<KeyLike>;
74
78
  /**
75
- * Imports a JWK to a runtime-specific key representation (KeyLike). Either
76
- * JWK "alg" (Algorithm) Parameter must be present or the optional "alg" argument. When
77
- * running on a runtime using [Web Cryptography API](https://www.w3.org/TR/WebCryptoAPI/)
78
- * the jwk parameters "use", "key_ops", and "ext" are also used in the resulting `CryptoKey`.
79
- * See [Algorithm Key Requirements](https://github.com/panva/jose/issues/210) to learn about key to algorithm
79
+ * Imports a JWK to a runtime-specific key representation (KeyLike). Either JWK "alg" (Algorithm)
80
+ * Parameter must be present or the optional "alg" argument. When running on a runtime using [Web
81
+ * Cryptography API](https://www.w3.org/TR/WebCryptoAPI/) the jwk parameters "use", "key_ops", and
82
+ * "ext" are also used in the resulting `CryptoKey`. See [Algorithm Key
83
+ * Requirements](https://github.com/panva/jose/issues/210) to learn about key to algorithm
80
84
  * requirements and mapping.
81
85
  *
82
- * @param jwk JSON Web Key.
83
- * @param alg JSON Web Algorithm identifier to be used with the imported key.
84
- * Default is the "alg" property on the JWK.
85
- * @param octAsKeyObject Forces a symmetric key to be imported to a KeyObject or
86
- * CryptoKey. Default is true unless JWK "ext" (Extractable) is true.
87
- *
88
86
  * @example Usage
87
+ *
89
88
  * ```js
90
- * const ecPublicKey = await jose.importJWK({
91
- * crv: 'P-256',
92
- * kty: 'EC',
93
- * x: 'ySK38C1jBdLwDsNWKzzBHqKYEE5Cgv-qjWvorUXk9fw',
94
- * y: '_LeQBw07cf5t57Iavn4j-BqJsAD1dpoz8gokd3sBsOo'
95
- * }, 'ES256')
89
+ * const ecPublicKey = await jose.importJWK(
90
+ * {
91
+ * crv: 'P-256',
92
+ * kty: 'EC',
93
+ * x: 'ySK38C1jBdLwDsNWKzzBHqKYEE5Cgv-qjWvorUXk9fw',
94
+ * y: '_LeQBw07cf5t57Iavn4j-BqJsAD1dpoz8gokd3sBsOo',
95
+ * },
96
+ * 'ES256',
97
+ * )
96
98
  *
97
- * const rsaPublicKey = await jose.importJWK({
98
- * kty: 'RSA',
99
- * e: 'AQAB',
100
- * n: '12oBZRhCiZFJLcPg59LkZZ9mdhSMTKAQZYq32k_ti5SBB6jerkh-WzOMAO664r_qyLkqHUSp3u5SbXtseZEpN3XPWGKSxjsy-1JyEFTdLSYe6f9gfrmxkUF_7DTpq0gn6rntP05g2-wFW50YO7mosfdslfrTJYWHFhJALabAeYirYD7-9kqq9ebfFMF4sRRELbv9oi36As6Q9B3Qb5_C1rAzqfao_PCsf9EPsTZsVVVkA5qoIAr47lo1ipfiBPxUCCNSdvkmDTYgvvRm6ZoMjFbvOtgyts55fXKdMWv7I9HMD5HwE9uW839PWA514qhbcIsXEYSFMPMV6fnlsiZvQQ'
101
- * }, 'PS256')
99
+ * const rsaPublicKey = await jose.importJWK(
100
+ * {
101
+ * kty: 'RSA',
102
+ * e: 'AQAB',
103
+ * n: '12oBZRhCiZFJLcPg59LkZZ9mdhSMTKAQZYq32k_ti5SBB6jerkh-WzOMAO664r_qyLkqHUSp3u5SbXtseZEpN3XPWGKSxjsy-1JyEFTdLSYe6f9gfrmxkUF_7DTpq0gn6rntP05g2-wFW50YO7mosfdslfrTJYWHFhJALabAeYirYD7-9kqq9ebfFMF4sRRELbv9oi36As6Q9B3Qb5_C1rAzqfao_PCsf9EPsTZsVVVkA5qoIAr47lo1ipfiBPxUCCNSdvkmDTYgvvRm6ZoMjFbvOtgyts55fXKdMWv7I9HMD5HwE9uW839PWA514qhbcIsXEYSFMPMV6fnlsiZvQQ',
104
+ * },
105
+ * 'PS256',
106
+ * )
102
107
  * ```
108
+ *
109
+ * @param jwk JSON Web Key.
110
+ * @param alg JSON Web Algorithm identifier to be used with the imported key. Default is the "alg"
111
+ * property on the JWK.
112
+ * @param octAsKeyObject Forces a symmetric key to be imported to a KeyObject or CryptoKey. Default
113
+ * is true unless JWK "ext" (Extractable) is true.
103
114
  */
104
115
  export declare function importJWK(jwk: JWK, alg?: string, octAsKeyObject?: boolean): Promise<KeyLike | Uint8Array>;