jose 6.0.0 → 6.0.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.
- package/dist/types/index.d.ts +53 -47
- package/dist/types/jwe/compact/decrypt.d.ts +6 -1
- package/dist/types/jwe/compact/encrypt.d.ts +6 -1
- package/dist/types/jwe/flattened/decrypt.d.ts +6 -1
- package/dist/types/jwe/flattened/encrypt.d.ts +6 -1
- package/dist/types/jwe/general/decrypt.d.ts +6 -1
- package/dist/types/jwe/general/encrypt.d.ts +6 -1
- package/dist/types/jwk/embedded.d.ts +6 -1
- package/dist/types/jwk/thumbprint.d.ts +6 -1
- package/dist/types/jwks/local.d.ts +6 -1
- package/dist/types/jwks/remote.d.ts +6 -1
- package/dist/types/jws/compact/sign.d.ts +6 -1
- package/dist/types/jws/compact/verify.d.ts +6 -1
- package/dist/types/jws/flattened/sign.d.ts +6 -1
- package/dist/types/jws/flattened/verify.d.ts +6 -1
- package/dist/types/jws/general/sign.d.ts +6 -1
- package/dist/types/jws/general/verify.d.ts +6 -1
- package/dist/types/jwt/decrypt.d.ts +6 -1
- package/dist/types/jwt/encrypt.d.ts +7 -2
- package/dist/types/jwt/produce.d.ts +1 -1
- package/dist/types/jwt/sign.d.ts +7 -2
- package/dist/types/jwt/unsecured.d.ts +7 -2
- package/dist/types/jwt/verify.d.ts +6 -1
- package/dist/types/key/export.d.ts +6 -1
- package/dist/types/key/generate_key_pair.d.ts +6 -1
- package/dist/types/key/generate_secret.d.ts +6 -1
- package/dist/types/key/import.d.ts +6 -1
- package/dist/types/util/base64url.d.ts +5 -0
- package/dist/types/util/decode_jwt.d.ts +6 -1
- package/dist/types/util/decode_protected_header.d.ts +6 -1
- package/dist/types/util/errors.d.ts +6 -1
- package/dist/webapi/jwks/remote.js +1 -1
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,48 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export {
|
|
8
|
-
export type {
|
|
9
|
-
export {
|
|
10
|
-
export type {
|
|
11
|
-
export {
|
|
12
|
-
export type {
|
|
13
|
-
export {
|
|
14
|
-
export type {
|
|
15
|
-
export {
|
|
16
|
-
export type {
|
|
17
|
-
export {
|
|
18
|
-
export type {
|
|
19
|
-
export
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export type {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
31
|
-
export {
|
|
32
|
-
export
|
|
33
|
-
export {
|
|
34
|
-
export
|
|
35
|
-
export {
|
|
36
|
-
export {
|
|
37
|
-
export
|
|
38
|
-
export {
|
|
39
|
-
export {
|
|
40
|
-
export type {
|
|
41
|
-
export
|
|
42
|
-
export {
|
|
43
|
-
export type {
|
|
44
|
-
export {
|
|
45
|
-
export
|
|
46
|
-
export
|
|
47
|
-
export
|
|
1
|
+
/**
|
|
2
|
+
* JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other
|
|
3
|
+
* Web-interoperable runtimes
|
|
4
|
+
*
|
|
5
|
+
* @module jose
|
|
6
|
+
*/
|
|
7
|
+
export { compactDecrypt } from './jwe/compact/decrypt.js';
|
|
8
|
+
export type { CompactDecryptGetKey } from './jwe/compact/decrypt.js';
|
|
9
|
+
export { flattenedDecrypt } from './jwe/flattened/decrypt.js';
|
|
10
|
+
export type { FlattenedDecryptGetKey } from './jwe/flattened/decrypt.js';
|
|
11
|
+
export { generalDecrypt } from './jwe/general/decrypt.js';
|
|
12
|
+
export type { GeneralDecryptGetKey } from './jwe/general/decrypt.js';
|
|
13
|
+
export { GeneralEncrypt } from './jwe/general/encrypt.js';
|
|
14
|
+
export type { Recipient } from './jwe/general/encrypt.js';
|
|
15
|
+
export { compactVerify } from './jws/compact/verify.js';
|
|
16
|
+
export type { CompactVerifyGetKey } from './jws/compact/verify.js';
|
|
17
|
+
export { flattenedVerify } from './jws/flattened/verify.js';
|
|
18
|
+
export type { FlattenedVerifyGetKey } from './jws/flattened/verify.js';
|
|
19
|
+
export { generalVerify } from './jws/general/verify.js';
|
|
20
|
+
export type { GeneralVerifyGetKey } from './jws/general/verify.js';
|
|
21
|
+
export { jwtVerify } from './jwt/verify.js';
|
|
22
|
+
export type { JWTVerifyOptions, JWTVerifyGetKey } from './jwt/verify.js';
|
|
23
|
+
export { jwtDecrypt } from './jwt/decrypt.js';
|
|
24
|
+
export type { JWTDecryptOptions, JWTDecryptGetKey } from './jwt/decrypt.js';
|
|
25
|
+
export type { ProduceJWT } from './jwt/produce.js';
|
|
26
|
+
export { CompactEncrypt } from './jwe/compact/encrypt.js';
|
|
27
|
+
export { FlattenedEncrypt } from './jwe/flattened/encrypt.js';
|
|
28
|
+
export { CompactSign } from './jws/compact/sign.js';
|
|
29
|
+
export { FlattenedSign } from './jws/flattened/sign.js';
|
|
30
|
+
export { GeneralSign } from './jws/general/sign.js';
|
|
31
|
+
export type { Signature } from './jws/general/sign.js';
|
|
32
|
+
export { SignJWT } from './jwt/sign.js';
|
|
33
|
+
export { EncryptJWT } from './jwt/encrypt.js';
|
|
34
|
+
export { calculateJwkThumbprint, calculateJwkThumbprintUri } from './jwk/thumbprint.js';
|
|
35
|
+
export { EmbeddedJWK } from './jwk/embedded.js';
|
|
36
|
+
export { createLocalJWKSet } from './jwks/local.js';
|
|
37
|
+
export { createRemoteJWKSet, jwksCache } from './jwks/remote.js';
|
|
38
|
+
export type { RemoteJWKSetOptions, JWKSCacheInput, ExportedJWKSCache, customFetch, FetchImplementation, } from './jwks/remote.js';
|
|
39
|
+
export { UnsecuredJWT } from './jwt/unsecured.js';
|
|
40
|
+
export type { UnsecuredResult } from './jwt/unsecured.js';
|
|
41
|
+
export { exportPKCS8, exportSPKI, exportJWK } from './key/export.js';
|
|
42
|
+
export { importSPKI, importPKCS8, importX509, importJWK } from './key/import.js';
|
|
43
|
+
export type { KeyImportOptions } from './key/import.js';
|
|
44
|
+
export { decodeProtectedHeader } from './util/decode_protected_header.js';
|
|
45
|
+
export { decodeJwt } from './util/decode_jwt.js';
|
|
46
|
+
export type { ProtectedHeaderParameters } from './util/decode_protected_header.js';
|
|
47
|
+
export * as errors from './util/errors.js';
|
|
48
|
+
export { generateKeyPair } from './key/generate_key_pair.js';
|
|
49
|
+
export type { GenerateKeyPairResult, GenerateKeyPairOptions } from './key/generate_key_pair.js';
|
|
50
|
+
export { generateSecret } from './key/generate_secret.js';
|
|
51
|
+
export type { GenerateSecretOptions } from './key/generate_secret.js';
|
|
52
|
+
export * as base64url from './util/base64url.js';
|
|
53
|
+
export type { CompactDecryptResult, CompactJWEHeaderParameters, CompactJWSHeaderParameters, CompactVerifyResult, CritOption, CryptoKey, DecryptOptions, EncryptOptions, FlattenedDecryptResult, FlattenedJWE, FlattenedJWS, FlattenedJWSInput, FlattenedVerifyResult, GeneralDecryptResult, GeneralJWE, GeneralJWS, GeneralJWSInput, GeneralVerifyResult, GetKeyFunction, JoseHeaderParameters, JSONWebKeySet, JWEHeaderParameters, JWEKeyManagementHeaderParameters, JWK_EC_Private, JWK_EC_Public, JWK_oct, JWK_OKP_Private, JWK_OKP_Public, JWK_RSA_Private, JWK_RSA_Public, JWK, JWKParameters, JWSHeaderParameters, JWTClaimVerificationOptions, JWTDecryptResult, JWTHeaderParameters, JWTPayload, JWTVerifyResult, KeyObject, ResolvedKey, SignOptions, VerifyOptions, } from './types.d.ts';
|
|
48
54
|
export declare const cryptoRuntime = "WebCryptoAPI";
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Decrypting JSON Web Encryption (JWE) in Compact Serialization
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../../types.d.ts';
|
|
2
7
|
/**
|
|
3
8
|
* Interface for Compact JWE Decryption dynamic key resolution. No token components have been
|
|
4
9
|
* verified at the time of this function call.
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Encrypting JSON Web Encryption (JWE) in Compact Serialization
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../../types.d.ts';
|
|
2
7
|
/**
|
|
3
8
|
* The CompactEncrypt class is used to build and encrypt Compact JWE strings.
|
|
4
9
|
*
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Decrypting JSON Web Encryption (JWE) in Flattened JSON Serialization
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../../types.d.ts';
|
|
2
7
|
/**
|
|
3
8
|
* Interface for Flattened JWE Decryption dynamic key resolution. No token components have been
|
|
4
9
|
* verified at the time of this function call.
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Encrypting JSON Web Encryption (JWE) in Flattened JSON Serialization
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../../types.d.ts';
|
|
2
7
|
/**
|
|
3
8
|
* The FlattenedEncrypt class is used to build and encrypt Flattened JWE objects.
|
|
4
9
|
*
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Decrypting JSON Web Encryption (JWE) in General JSON Serialization
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../../types.d.ts';
|
|
2
7
|
/**
|
|
3
8
|
* Interface for General JWE Decryption dynamic key resolution. No token components have been
|
|
4
9
|
* verified at the time of this function call.
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Encrypting JSON Web Encryption (JWE) in General JSON Serialization
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../../types.d.ts';
|
|
2
7
|
export interface Recipient {
|
|
3
8
|
/**
|
|
4
9
|
* Sets the JWE Per-Recipient Unprotected Header on the Recipient object.
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Verification using a JWK Embedded in a JWS Header
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../types.d.ts';
|
|
2
7
|
/**
|
|
3
8
|
* EmbeddedJWK is an implementation of a GetKeyFunction intended to be used with the JWS/JWT verify
|
|
4
9
|
* operations whenever you need to opt-in to verify signatures with a public key embedded in the
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Verification using a JSON Web Key Set (JWKS) available locally
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../types.d.ts';
|
|
2
7
|
/**
|
|
3
8
|
* Returns a function that resolves a JWS JOSE Header to a public key object from a locally stored,
|
|
4
9
|
* or otherwise available, JSON Web Key Set.
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Verification using a JSON Web Key Set (JWKS) available on an HTTP(S) URL
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../types.d.ts';
|
|
2
7
|
/**
|
|
3
8
|
* When passed to {@link jwks/remote.createRemoteJWKSet createRemoteJWKSet} this allows the resolver
|
|
4
9
|
* to make use of advanced fetch configurations, HTTP Proxies, retry on network errors, etc.
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Signing JSON Web Signature (JWS) in Compact Serialization
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../../types.d.ts';
|
|
2
7
|
/**
|
|
3
8
|
* The CompactSign class is used to build and sign Compact JWS strings.
|
|
4
9
|
*
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Verifying JSON Web Signature (JWS) in Compact Serialization
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../../types.d.ts';
|
|
2
7
|
/**
|
|
3
8
|
* Interface for Compact JWS Verification dynamic key resolution. No token components have been
|
|
4
9
|
* verified at the time of this function call.
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Signing JSON Web Signature (JWS) in Flattened JSON Serialization
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../../types.d.ts';
|
|
2
7
|
/**
|
|
3
8
|
* The FlattenedSign class is used to build and sign Flattened JWS objects.
|
|
4
9
|
*
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Verifying JSON Web Signature (JWS) in Flattened JSON Serialization
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../../types.d.ts';
|
|
2
7
|
/**
|
|
3
8
|
* Interface for Flattened JWS Verification dynamic key resolution. No token components have been
|
|
4
9
|
* verified at the time of this function call.
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Signing JSON Web Signature (JWS) in General JSON Serialization
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../../types.d.ts';
|
|
2
7
|
export interface Signature {
|
|
3
8
|
/**
|
|
4
9
|
* Sets the JWS Protected Header on the Signature object.
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Verifying JSON Web Signature (JWS) in General JSON Serialization
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../../types.d.ts';
|
|
2
7
|
/**
|
|
3
8
|
* Interface for General JWS Verification dynamic key resolution. No token components have been
|
|
4
9
|
* verified at the time of this function call.
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* JSON Web Token (JWT) Decryption (JWT is in JWE format)
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../types.d.ts';
|
|
2
7
|
/** Combination of JWE Decryption options and JWT Claims Set verification options. */
|
|
3
8
|
export interface JWTDecryptOptions extends types.DecryptOptions, types.JWTClaimVerificationOptions {
|
|
4
9
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* JSON Web Token (JWT) Encryption (JWT is in JWE format)
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../types.d.ts';
|
|
7
|
+
import { ProduceJWT } from './produce.js';
|
|
3
8
|
/**
|
|
4
9
|
* The EncryptJWT class is used to build and encrypt Compact JWE formatted JSON Web Tokens.
|
|
5
10
|
*
|
package/dist/types/jwt/sign.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* JSON Web Token (JWT) Signing (JWT is in JWS format)
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../types.d.ts';
|
|
7
|
+
import { ProduceJWT } from './produce.js';
|
|
3
8
|
/**
|
|
4
9
|
* The SignJWT class is used to build and sign Compact JWS formatted JSON Web Tokens.
|
|
5
10
|
*
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Unsecured (unsigned & unencrypted) JSON Web Tokens (JWT)
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../types.d.ts';
|
|
7
|
+
import { ProduceJWT } from './produce.js';
|
|
3
8
|
export interface UnsecuredResult<PayloadType = types.JWTPayload> {
|
|
4
9
|
payload: PayloadType & types.JWTPayload;
|
|
5
10
|
header: types.JWSHeaderParameters;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* JSON Web Token (JWT) Verification (JWT is in JWS format)
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../types.d.ts';
|
|
2
7
|
/** Combination of JWS Verification options and JWT Claims Set verification options. */
|
|
3
8
|
export interface JWTVerifyOptions extends types.VerifyOptions, types.JWTClaimVerificationOptions {
|
|
4
9
|
}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Symmetric key generation
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../types.d.ts';
|
|
2
7
|
export interface GenerateSecretOptions {
|
|
3
8
|
/** The value to use as {@link !SubtleCrypto.generateKey} `extractable` argument. Default is false. */
|
|
4
9
|
extractable?: boolean;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Cryptographic key import functions
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../types.d.ts';
|
|
2
7
|
export interface KeyImportOptions {
|
|
3
8
|
/**
|
|
4
9
|
* The value to use as {@link !SubtleCrypto.importKey} `extractable` argument. Default is false for
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* JSON Web Token (JWT) Claims Set Decoding (no validation, no signature checking)
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../types.d.ts';
|
|
2
7
|
/**
|
|
3
8
|
* Decodes a signed JSON Web Token payload. This does not validate the JWT Claims Set types or
|
|
4
9
|
* values. This does not validate the JWS Signature. For a proper Signed JWT Claims Set validation
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* JOSE Protected Header Decoding (JWE, JWS, all serialization syntaxes)
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type * as types from '../types.d.ts';
|
|
2
7
|
export type ProtectedHeaderParameters = types.JWSHeaderParameters & types.JWEHeaderParameters;
|
|
3
8
|
/**
|
|
4
9
|
* Decodes the Protected Header of a JWE/JWS/JWT token utilizing any JOSE serialization.
|
|
@@ -9,7 +9,7 @@ function isCloudflareWorkers() {
|
|
|
9
9
|
let USER_AGENT;
|
|
10
10
|
if (typeof navigator === 'undefined' || !navigator.userAgent?.startsWith?.('Mozilla/5.0 ')) {
|
|
11
11
|
const NAME = 'jose';
|
|
12
|
-
const VERSION = 'v6.0.
|
|
12
|
+
const VERSION = 'v6.0.2';
|
|
13
13
|
USER_AGENT = `${NAME}/${VERSION}`;
|
|
14
14
|
}
|
|
15
15
|
export const customFetch = Symbol();
|