jose-node-cjs-runtime
Advanced tools
Comparing version 5.7.0 to 5.8.0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.FlattenedEncrypt = exports.unprotected = void 0; | ||
exports.FlattenedEncrypt = void 0; | ||
const base64url_js_1 = require("../../runtime/base64url.js"); | ||
const private_symbols_js_1 = require("../../lib/private_symbols.js"); | ||
const encrypt_js_1 = require("../../runtime/encrypt.js"); | ||
@@ -11,3 +12,2 @@ const encrypt_key_management_js_1 = require("../../lib/encrypt_key_management.js"); | ||
const validate_crit_js_1 = require("../../lib/validate_crit.js"); | ||
exports.unprotected = Symbol(); | ||
class FlattenedEncrypt { | ||
@@ -106,3 +106,3 @@ _plaintext; | ||
if (parameters) { | ||
if (options && exports.unprotected in options) { | ||
if (options && private_symbols_js_1.unprotected in options) { | ||
if (!this._unprotectedHeader) { | ||
@@ -109,0 +109,0 @@ this.setUnprotectedHeader(parameters); |
@@ -5,2 +5,3 @@ "use strict"; | ||
const encrypt_js_1 = require("../flattened/encrypt.js"); | ||
const private_symbols_js_1 = require("../../lib/private_symbols.js"); | ||
const errors_js_1 = require("../../util/errors.js"); | ||
@@ -160,3 +161,3 @@ const cek_js_1 = require("../../lib/cek.js"); | ||
...recipient.options, | ||
[encrypt_js_1.unprotected]: true, | ||
[private_symbols_js_1.unprotected]: true, | ||
}); | ||
@@ -163,0 +164,0 @@ jwe.ciphertext = flattened.ciphertext; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.createLocalJWKSet = exports.LocalJWKSet = void 0; | ||
exports.createLocalJWKSet = void 0; | ||
const import_js_1 = require("../key/import.js"); | ||
@@ -102,3 +102,2 @@ const errors_js_1 = require("../util/errors.js"); | ||
} | ||
exports.LocalJWKSet = LocalJWKSet; | ||
async function importWithAlgCache(cache, jwk, alg) { | ||
@@ -105,0 +104,0 @@ const cached = cache.get(jwk) || cache.set(jwk, {}).get(jwk); |
@@ -16,3 +16,3 @@ "use strict"; | ||
const NAME = 'jose'; | ||
const VERSION = 'v5.7.0'; | ||
const VERSION = 'v5.8.0'; | ||
USER_AGENT = `${NAME}/${VERSION}`; | ||
@@ -19,0 +19,0 @@ } |
@@ -11,2 +11,5 @@ import type { KeyLike, DecryptOptions, CompactJWEHeaderParameters, GetKeyFunction, FlattenedJWE, CompactDecryptResult, ResolvedKey } from '../../types'; | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/jwe/compact/decrypt'`. | ||
* | ||
* @param jwe Compact JWE. | ||
@@ -13,0 +16,0 @@ * @param key Private Key or Secret to decrypt the JWE with. See |
@@ -5,2 +5,5 @@ import type { KeyLike, JWEKeyManagementHeaderParameters, CompactJWEHeaderParameters, EncryptOptions } from '../../types'; | ||
* | ||
* This class is exported (as a named export) from the main `'jose'` module entry point as well as | ||
* from its subpath export `'jose/jwe/compact/encrypt'`. | ||
* | ||
*/ | ||
@@ -7,0 +10,0 @@ export declare class CompactEncrypt { |
@@ -11,2 +11,5 @@ import type { FlattenedDecryptResult, KeyLike, FlattenedJWE, JWEHeaderParameters, DecryptOptions, GetKeyFunction, ResolvedKey } from '../../types'; | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/jwe/flattened/decrypt'`. | ||
* | ||
* @param jwe Flattened JWE. | ||
@@ -13,0 +16,0 @@ * @param key Private Key or Secret to decrypt the JWE with. See |
import type { KeyLike, FlattenedJWE, JWEHeaderParameters, JWEKeyManagementHeaderParameters, EncryptOptions } from '../../types'; | ||
/** @private */ | ||
export declare const unprotected: unique symbol; | ||
/** | ||
* The FlattenedEncrypt class is used to build and encrypt Flattened JWE objects. | ||
* | ||
* This class is exported (as a named export) from the main `'jose'` module entry point as well as | ||
* from its subpath export `'jose/jwe/flattened/encrypt'`. | ||
* | ||
*/ | ||
@@ -8,0 +9,0 @@ export declare class FlattenedEncrypt { |
@@ -11,2 +11,5 @@ import type { KeyLike, DecryptOptions, JWEHeaderParameters, GetKeyFunction, FlattenedJWE, GeneralJWE, GeneralDecryptResult, ResolvedKey } from '../../types'; | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/jwe/general/decrypt'`. | ||
* | ||
* @param jwe General JWE. | ||
@@ -13,0 +16,0 @@ * @param key Private Key or Secret to decrypt the JWE with. See |
@@ -19,2 +19,5 @@ import type { KeyLike, GeneralJWE, JWEHeaderParameters, CritOption } from '../../types'; | ||
* | ||
* This class is exported (as a named export) from the main `'jose'` module entry point as well as | ||
* from its subpath export `'jose/jwe/general/encrypt'`. | ||
* | ||
*/ | ||
@@ -21,0 +24,0 @@ export declare class GeneralEncrypt { |
@@ -8,3 +8,6 @@ import type { KeyLike, FlattenedJWSInput, JWSHeaderParameters } from '../types'; | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/jwk/embedded'`. | ||
* | ||
*/ | ||
export declare function EmbeddedJWK<KeyLikeType extends KeyLike = KeyLike>(protectedHeader?: JWSHeaderParameters, token?: FlattenedJWSInput): Promise<KeyLikeType>; |
@@ -5,2 +5,5 @@ import type { JWK } from '../types'; | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/jwk/thumbprint'`. | ||
* | ||
* @param jwk JSON Web Key. | ||
@@ -16,2 +19,5 @@ * @param digestAlgorithm Digest Algorithm to use for calculating the thumbprint. Default is | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/jwk/thumbprint'`. | ||
* | ||
* @param jwk JSON Web Key. | ||
@@ -18,0 +24,0 @@ * @param digestAlgorithm Digest Algorithm to use for calculating the thumbprint. Default is |
import type { KeyLike, JWSHeaderParameters, JSONWebKeySet, FlattenedJWSInput } from '../types'; | ||
/** @private */ | ||
export declare class LocalJWKSet<KeyLikeType extends KeyLike = KeyLike> { | ||
private _jwks?; | ||
private _cached; | ||
constructor(jwks: unknown); | ||
getKey(protectedHeader?: JWSHeaderParameters, token?: FlattenedJWSInput): Promise<KeyLikeType>; | ||
} | ||
/** | ||
@@ -25,4 +18,7 @@ * Returns a function that resolves a JWS JOSE Header to a public key object from a locally stored, | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/jwks/local'`. | ||
* | ||
* @param jwks JSON Web Key Set formatted object. | ||
*/ | ||
export declare function createLocalJWKSet<KeyLikeType extends KeyLike = KeyLike>(jwks: JSONWebKeySet): (protectedHeader?: JWSHeaderParameters, token?: FlattenedJWSInput) => Promise<KeyLikeType>; |
@@ -111,2 +111,5 @@ import type { KeyLike, JWSHeaderParameters, FlattenedJWSInput, JSONWebKeySet } from '../types'; | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/jwks/remote'`. | ||
* | ||
* @param url URL to fetch the JSON Web Key Set from. | ||
@@ -113,0 +116,0 @@ * @param options Options for the remote JSON Web Key Set. |
@@ -5,2 +5,5 @@ import type { CompactJWSHeaderParameters, KeyLike, SignOptions } from '../../types'; | ||
* | ||
* This class is exported (as a named export) from the main `'jose'` module entry point as well as | ||
* from its subpath export `'jose/jws/compact/sign'`. | ||
* | ||
*/ | ||
@@ -7,0 +10,0 @@ export declare class CompactSign { |
@@ -13,2 +13,5 @@ import type { CompactVerifyResult, FlattenedJWSInput, GetKeyFunction, CompactJWSHeaderParameters, KeyLike, VerifyOptions, ResolvedKey } from '../../types'; | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/jws/compact/verify'`. | ||
* | ||
* @param jws Compact JWS. | ||
@@ -15,0 +18,0 @@ * @param key Key to verify the JWS with. See |
@@ -5,2 +5,5 @@ import type { KeyLike, FlattenedJWS, JWSHeaderParameters, SignOptions } from '../../types'; | ||
* | ||
* This class is exported (as a named export) from the main `'jose'` module entry point as well as | ||
* from its subpath export `'jose/jws/flattened/sign'`. | ||
* | ||
*/ | ||
@@ -7,0 +10,0 @@ export declare class FlattenedSign { |
@@ -13,2 +13,5 @@ import type { FlattenedVerifyResult, KeyLike, FlattenedJWSInput, JWSHeaderParameters, VerifyOptions, GetKeyFunction, ResolvedKey } from '../../types'; | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/jws/flattened/verify'`. | ||
* | ||
* @param jws Flattened JWS. | ||
@@ -15,0 +18,0 @@ * @param key Key to verify the JWS with. See |
@@ -25,2 +25,5 @@ import type { KeyLike, GeneralJWS, JWSHeaderParameters, SignOptions } from '../../types'; | ||
* | ||
* This class is exported (as a named export) from the main `'jose'` module entry point as well as | ||
* from its subpath export `'jose/jws/general/sign'`. | ||
* | ||
*/ | ||
@@ -27,0 +30,0 @@ export declare class GeneralSign { |
@@ -13,2 +13,5 @@ import type { GeneralJWSInput, GeneralVerifyResult, FlattenedJWSInput, GetKeyFunction, JWSHeaderParameters, KeyLike, VerifyOptions, ResolvedKey } from '../../types'; | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/jws/general/verify'`. | ||
* | ||
* @param jws General JWS. | ||
@@ -15,0 +18,0 @@ * @param key Key to verify the JWS with. See |
@@ -15,2 +15,5 @@ import type { JWTPayload, KeyLike, DecryptOptions, JWTClaimVerificationOptions, GetKeyFunction, CompactJWEHeaderParameters, FlattenedJWE, JWTDecryptResult, ResolvedKey } from '../types'; | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/jwt/decrypt'`. | ||
* | ||
* @param jwt JSON Web Token value (encoded as JWE). | ||
@@ -17,0 +20,0 @@ * @param key Private Key or Secret to decrypt and verify the JWT with. See |
@@ -6,2 +6,5 @@ import type { EncryptOptions, CompactJWEHeaderParameters, JWEKeyManagementHeaderParameters, KeyLike } from '../types'; | ||
* | ||
* This class is exported (as a named export) from the main `'jose'` module entry point as well as | ||
* from its subpath export `'jose/jwt/encrypt'`. | ||
* | ||
*/ | ||
@@ -8,0 +11,0 @@ export declare class EncryptJWT extends ProduceJWT { |
@@ -6,2 +6,5 @@ import type { JWTHeaderParameters, KeyLike, SignOptions } from '../types'; | ||
* | ||
* This class is exported (as a named export) from the main `'jose'` module entry point as well as | ||
* from its subpath export `'jose/jwt/sign'`. | ||
* | ||
*/ | ||
@@ -8,0 +11,0 @@ export declare class SignJWT extends ProduceJWT { |
@@ -10,2 +10,5 @@ import type { JWSHeaderParameters, JWTClaimVerificationOptions, JWTPayload } from '../types'; | ||
* | ||
* This class is exported (as a named export) from the main `'jose'` module entry point as well as | ||
* from its subpath export `'jose/jwt/unsecured'`. | ||
* | ||
*/ | ||
@@ -12,0 +15,0 @@ export declare class UnsecuredJWT extends ProduceJWT { |
@@ -17,2 +17,5 @@ import type { JWTPayload, KeyLike, VerifyOptions, JWTClaimVerificationOptions, JWTHeaderParameters, GetKeyFunction, FlattenedJWSInput, JWTVerifyResult, ResolvedKey } from '../types'; | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/jwt/verify'`. | ||
* | ||
* @param jwt JSON Web Token value (encoded as JWS). | ||
@@ -19,0 +22,0 @@ * @param key Key to verify the JWT with. See |
@@ -6,2 +6,5 @@ import type { JWK, KeyLike } from '../types'; | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/key/export'`. | ||
* | ||
* @param key Key representation to transform to a PEM-encoded SPKI string format. | ||
@@ -14,2 +17,5 @@ */ | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/key/export'`. | ||
* | ||
* @param key Key representation to transform to a PEM-encoded PKCS8 string format. | ||
@@ -21,4 +27,7 @@ */ | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/key/export'`. | ||
* | ||
* @param key Key representation to export as JWK. | ||
*/ | ||
export declare function exportJWK(key: KeyLike | Uint8Array): Promise<JWK>; |
@@ -35,2 +35,5 @@ import type { KeyLike } from '../types'; | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/generate/keypair'`. | ||
* | ||
* @param alg JWA Algorithm Identifier to be used with the generated key pair. | ||
@@ -37,0 +40,0 @@ * @param options Additional options passed down to the key pair generation. |
@@ -16,2 +16,5 @@ import type { KeyLike } from '../types'; | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/generate/secret'`. | ||
* | ||
* @param alg JWA Algorithm Identifier to be used with the generated secret. | ||
@@ -18,0 +21,0 @@ * @param options Additional options passed down to the secret generation. |
@@ -18,2 +18,5 @@ import type { JWK, KeyLike } from '../types'; | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/key/import'`. | ||
* | ||
* @param spki PEM-encoded SPKI string | ||
@@ -33,2 +36,5 @@ * @param alg (Only effective in Web Crypto API runtimes) JSON Web Algorithm identifier to be used | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/key/import'`. | ||
* | ||
* @param x509 X.509 certificate string | ||
@@ -48,2 +54,5 @@ * @param alg (Only effective in Web Crypto API runtimes) JSON Web Algorithm identifier to be used | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/key/import'`. | ||
* | ||
* @param pkcs8 PEM-encoded PKCS#8 string | ||
@@ -62,2 +71,5 @@ * @param alg (Only effective in Web Crypto API runtimes) JSON Web Algorithm identifier to be used | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/key/import'`. | ||
* | ||
* @param jwk JSON Web Key. | ||
@@ -64,0 +76,0 @@ * @param alg (Only effective in Web Crypto API runtimes) JSON Web Algorithm identifier to be used |
@@ -8,4 +8,7 @@ import type { JWTPayload } from '../types'; | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/jwt/decode'`. | ||
* | ||
* @param jwt JWT token in compact JWS serialization. | ||
*/ | ||
export declare function decodeJwt<PayloadType = JWTPayload>(jwt: string): PayloadType & JWTPayload; |
@@ -6,4 +6,7 @@ import type { JWSHeaderParameters, JWEHeaderParameters } from '../types'; | ||
* | ||
* This function is exported (as a named export) from the main `'jose'` module entry point as well | ||
* as from its subpath export `'jose/decode/protected_header'`. | ||
* | ||
* @param token JWE/JWS/JWT token in any JOSE serialization. | ||
*/ | ||
export declare function decodeProtectedHeader(token: string | object): ProtectedHeaderParameters; |
110
package.json
{ | ||
"name": "jose-node-cjs-runtime", | ||
"version": "5.7.0", | ||
"version": "5.8.0", | ||
"homepage": "https://github.com/panva/jose", | ||
@@ -17,2 +17,110 @@ "repository": "panva/jose", | ||
}, | ||
"./jwk/embedded": { | ||
"types": "./dist/types/jwk/embedded.d.ts", | ||
"require": "./dist/node/cjs/jwk/embedded.js" | ||
}, | ||
"./jwk/thumbprint": { | ||
"types": "./dist/types/jwk/thumbprint.d.ts", | ||
"require": "./dist/node/cjs/jwk/thumbprint.js" | ||
}, | ||
"./key/import": { | ||
"types": "./dist/types/key/import.d.ts", | ||
"require": "./dist/node/cjs/key/import.js" | ||
}, | ||
"./key/export": { | ||
"types": "./dist/types/key/export.d.ts", | ||
"require": "./dist/node/cjs/key/export.js" | ||
}, | ||
"./key/generate/keypair": { | ||
"types": "./dist/types/key/generate_key_pair.d.ts", | ||
"require": "./dist/node/cjs/key/generate_key_pair.js" | ||
}, | ||
"./key/generate/secret": { | ||
"types": "./dist/types/key/generate_secret.d.ts", | ||
"require": "./dist/node/cjs/key/generate_secret.js" | ||
}, | ||
"./jwks/remote": { | ||
"types": "./dist/types/jwks/remote.d.ts", | ||
"require": "./dist/node/cjs/jwks/remote.js" | ||
}, | ||
"./jwks/local": { | ||
"types": "./dist/types/jwks/local.d.ts", | ||
"require": "./dist/node/cjs/jwks/local.js" | ||
}, | ||
"./jwt/sign": { | ||
"types": "./dist/types/jwt/sign.d.ts", | ||
"require": "./dist/node/cjs/jwt/sign.js" | ||
}, | ||
"./jwt/verify": { | ||
"types": "./dist/types/jwt/verify.d.ts", | ||
"require": "./dist/node/cjs/jwt/verify.js" | ||
}, | ||
"./jwt/encrypt": { | ||
"types": "./dist/types/jwt/encrypt.d.ts", | ||
"require": "./dist/node/cjs/jwt/encrypt.js" | ||
}, | ||
"./jwt/decrypt": { | ||
"types": "./dist/types/jwt/decrypt.d.ts", | ||
"require": "./dist/node/cjs/jwt/decrypt.js" | ||
}, | ||
"./jwt/unsecured": { | ||
"types": "./dist/types/jwt/unsecured.d.ts", | ||
"require": "./dist/node/cjs/jwt/unsecured.js" | ||
}, | ||
"./jwt/decode": { | ||
"types": "./dist/types/util/decode_jwt.d.ts", | ||
"require": "./dist/node/cjs/util/decode_jwt.js" | ||
}, | ||
"./decode/protected_header": { | ||
"types": "./dist/types/util/decode_protected_header.d.ts", | ||
"require": "./dist/node/cjs/util/decode_protected_header.js" | ||
}, | ||
"./jws/compact/sign": { | ||
"types": "./dist/types/jws/compact/sign.d.ts", | ||
"require": "./dist/node/cjs/jws/compact/sign.js" | ||
}, | ||
"./jws/compact/verify": { | ||
"types": "./dist/types/jws/compact/verify.d.ts", | ||
"require": "./dist/node/cjs/jws/compact/verify.js" | ||
}, | ||
"./jws/flattened/sign": { | ||
"types": "./dist/types/jws/flattened/sign.d.ts", | ||
"require": "./dist/node/cjs/jws/flattened/sign.js" | ||
}, | ||
"./jws/flattened/verify": { | ||
"types": "./dist/types/jws/flattened/verify.d.ts", | ||
"require": "./dist/node/cjs/jws/flattened/verify.js" | ||
}, | ||
"./jws/general/sign": { | ||
"types": "./dist/types/jws/general/sign.d.ts", | ||
"require": "./dist/node/cjs/jws/general/sign.js" | ||
}, | ||
"./jws/general/verify": { | ||
"types": "./dist/types/jws/general/verify.d.ts", | ||
"require": "./dist/node/cjs/jws/general/verify.js" | ||
}, | ||
"./jwe/compact/encrypt": { | ||
"types": "./dist/types/jwe/compact/encrypt.d.ts", | ||
"require": "./dist/node/cjs/jwe/compact/encrypt.js" | ||
}, | ||
"./jwe/compact/decrypt": { | ||
"types": "./dist/types/jwe/compact/decrypt.d.ts", | ||
"require": "./dist/node/cjs/jwe/compact/decrypt.js" | ||
}, | ||
"./jwe/flattened/encrypt": { | ||
"types": "./dist/types/jwe/flattened/encrypt.d.ts", | ||
"require": "./dist/node/cjs/jwe/flattened/encrypt.js" | ||
}, | ||
"./jwe/flattened/decrypt": { | ||
"types": "./dist/types/jwe/flattened/decrypt.d.ts", | ||
"require": "./dist/node/cjs/jwe/flattened/decrypt.js" | ||
}, | ||
"./jwe/general/encrypt": { | ||
"types": "./dist/types/jwe/general/encrypt.d.ts", | ||
"require": "./dist/node/cjs/jwe/general/encrypt.js" | ||
}, | ||
"./jwe/general/decrypt": { | ||
"types": "./dist/types/jwe/general/decrypt.d.ts", | ||
"require": "./dist/node/cjs/jwe/general/decrypt.js" | ||
}, | ||
"./errors": { | ||
@@ -19,0 +127,0 @@ "types": "./dist/types/util/errors.d.ts", |
248054
117
5792