jose-node-esm-runtime
Advanced tools
Comparing version 3.20.3 to 4.0.0
@@ -1,5 +0,5 @@ | ||
import decrypt from '../flattened/decrypt.js'; | ||
import { flattenedDecrypt } from '../flattened/decrypt.js'; | ||
import { JWEInvalid } from '../../util/errors.js'; | ||
import { decoder } from '../../lib/buffer_utils.js'; | ||
async function compactDecrypt(jwe, key, options) { | ||
export async function compactDecrypt(jwe, key, options) { | ||
if (jwe instanceof Uint8Array) { | ||
@@ -15,3 +15,3 @@ jwe = decoder.decode(jwe); | ||
} | ||
const decrypted = await decrypt({ | ||
const decrypted = await flattenedDecrypt({ | ||
ciphertext: (ciphertext || undefined), | ||
@@ -29,3 +29,1 @@ iv: (iv || undefined), | ||
} | ||
export { compactDecrypt }; | ||
export default compactDecrypt; |
@@ -1,3 +0,3 @@ | ||
import FlattenedEncrypt from '../flattened/encrypt.js'; | ||
class CompactEncrypt { | ||
import { FlattenedEncrypt } from '../flattened/encrypt.js'; | ||
export class CompactEncrypt { | ||
constructor(plaintext) { | ||
@@ -27,3 +27,1 @@ this._flattened = new FlattenedEncrypt(plaintext); | ||
} | ||
export { CompactEncrypt }; | ||
export default CompactEncrypt; |
@@ -12,3 +12,3 @@ import { decode as base64url } from '../../runtime/base64url.js'; | ||
import validateAlgorithms from '../../lib/validate_algorithms.js'; | ||
async function flattenedDecrypt(jwe, key, options) { | ||
export async function flattenedDecrypt(jwe, key, options) { | ||
var _a; | ||
@@ -139,3 +139,1 @@ if (!isObject(jwe)) { | ||
} | ||
export { flattenedDecrypt }; | ||
export default flattenedDecrypt; |
@@ -10,3 +10,3 @@ import { encode as base64url } from '../../runtime/base64url.js'; | ||
import validateCrit from '../../lib/validate_crit.js'; | ||
class FlattenedEncrypt { | ||
export class FlattenedEncrypt { | ||
constructor(plaintext) { | ||
@@ -166,3 +166,1 @@ if (!(plaintext instanceof Uint8Array)) { | ||
} | ||
export { FlattenedEncrypt }; | ||
export default FlattenedEncrypt; |
@@ -1,5 +0,5 @@ | ||
import decrypt from '../flattened/decrypt.js'; | ||
import { flattenedDecrypt } from '../flattened/decrypt.js'; | ||
import { JWEDecryptionFailed, JWEInvalid } from '../../util/errors.js'; | ||
import isObject from '../../lib/is_object.js'; | ||
async function generalDecrypt(jwe, key, options) { | ||
export async function generalDecrypt(jwe, key, options) { | ||
if (!isObject(jwe)) { | ||
@@ -13,3 +13,3 @@ throw new JWEInvalid('General JWE must be an object'); | ||
try { | ||
return await decrypt({ | ||
return await flattenedDecrypt({ | ||
aad: jwe.aad, | ||
@@ -30,3 +30,1 @@ ciphertext: jwe.ciphertext, | ||
} | ||
export { generalDecrypt }; | ||
export default generalDecrypt; |
import { importJWK } from '../key/import.js'; | ||
import isObject from '../lib/is_object.js'; | ||
import { JWSInvalid } from '../util/errors.js'; | ||
async function EmbeddedJWK(protectedHeader, token) { | ||
export async function EmbeddedJWK(protectedHeader, token) { | ||
const joseHeader = { | ||
@@ -18,3 +18,1 @@ ...protectedHeader, | ||
} | ||
export { EmbeddedJWK }; | ||
export default EmbeddedJWK; |
@@ -11,3 +11,3 @@ import digest from '../runtime/digest.js'; | ||
}; | ||
async function calculateThumbprint(jwk, digestAlgorithm = 'sha256') { | ||
export async function calculateJwkThumbprint(jwk, digestAlgorithm = 'sha256') { | ||
if (!isObject(jwk)) { | ||
@@ -44,3 +44,1 @@ throw new TypeError('JWK must be an object'); | ||
} | ||
export { calculateThumbprint }; | ||
export default calculateThumbprint; |
@@ -123,6 +123,4 @@ import fetchJwks from '../runtime/fetch_jwks.js'; | ||
} | ||
function createRemoteJWKSet(url, options) { | ||
export function createRemoteJWKSet(url, options) { | ||
return RemoteJWKSet.prototype.getKey.bind(new RemoteJWKSet(url, options)); | ||
} | ||
export { createRemoteJWKSet }; | ||
export default createRemoteJWKSet; |
@@ -1,3 +0,3 @@ | ||
import FlattenedSign from '../flattened/sign.js'; | ||
class CompactSign { | ||
import { FlattenedSign } from '../flattened/sign.js'; | ||
export class CompactSign { | ||
constructor(payload) { | ||
@@ -18,3 +18,1 @@ this._flattened = new FlattenedSign(payload); | ||
} | ||
export { CompactSign }; | ||
export default CompactSign; |
@@ -1,5 +0,5 @@ | ||
import verify from '../flattened/verify.js'; | ||
import { flattenedVerify } from '../flattened/verify.js'; | ||
import { JWSInvalid } from '../../util/errors.js'; | ||
import { decoder } from '../../lib/buffer_utils.js'; | ||
async function compactVerify(jws, key, options) { | ||
export async function compactVerify(jws, key, options) { | ||
if (jws instanceof Uint8Array) { | ||
@@ -15,3 +15,3 @@ jws = decoder.decode(jws); | ||
} | ||
const verified = await verify({ | ||
const verified = await flattenedVerify({ | ||
payload: (payload || undefined), | ||
@@ -27,3 +27,1 @@ protected: protectedHeader || undefined, | ||
} | ||
export { compactVerify }; | ||
export default compactVerify; |
@@ -8,3 +8,3 @@ import { encode as base64url } from '../../runtime/base64url.js'; | ||
import validateCrit from '../../lib/validate_crit.js'; | ||
class FlattenedSign { | ||
export class FlattenedSign { | ||
constructor(payload) { | ||
@@ -83,3 +83,1 @@ if (!(payload instanceof Uint8Array)) { | ||
} | ||
export { FlattenedSign }; | ||
export default FlattenedSign; |
@@ -10,3 +10,3 @@ import { decode as base64url } from '../../runtime/base64url.js'; | ||
import validateAlgorithms from '../../lib/validate_algorithms.js'; | ||
async function flattenedVerify(jws, key, options) { | ||
export async function flattenedVerify(jws, key, options) { | ||
var _a; | ||
@@ -106,3 +106,1 @@ if (!isObject(jws)) { | ||
} | ||
export { flattenedVerify }; | ||
export default flattenedVerify; |
@@ -1,2 +0,2 @@ | ||
import FlattenedSign from '../flattened/sign.js'; | ||
import { FlattenedSign } from '../flattened/sign.js'; | ||
import { JWSInvalid } from '../../util/errors.js'; | ||
@@ -32,3 +32,3 @@ const signatureRef = new WeakMap(); | ||
} | ||
class GeneralSign { | ||
export class GeneralSign { | ||
constructor(payload) { | ||
@@ -73,3 +73,1 @@ this._signatures = []; | ||
} | ||
export { GeneralSign }; | ||
export default GeneralSign; |
@@ -1,5 +0,5 @@ | ||
import verify from '../flattened/verify.js'; | ||
import { flattenedVerify } from '../flattened/verify.js'; | ||
import { JWSInvalid, JWSSignatureVerificationFailed } from '../../util/errors.js'; | ||
import isObject from '../../lib/is_object.js'; | ||
async function generalVerify(jws, key, options) { | ||
export async function generalVerify(jws, key, options) { | ||
if (!isObject(jws)) { | ||
@@ -13,3 +13,3 @@ throw new JWSInvalid('General JWS must be an object'); | ||
try { | ||
return await verify({ | ||
return await flattenedVerify({ | ||
header: signature.header, | ||
@@ -26,3 +26,1 @@ payload: jws.payload, | ||
} | ||
export { generalVerify }; | ||
export default generalVerify; |
@@ -1,6 +0,6 @@ | ||
import decrypt from '../jwe/compact/decrypt.js'; | ||
import { compactDecrypt } from '../jwe/compact/decrypt.js'; | ||
import jwtPayload from '../lib/jwt_claims_set.js'; | ||
import { JWTClaimValidationFailed } from '../util/errors.js'; | ||
async function jwtDecrypt(jwt, key, options) { | ||
const decrypted = await decrypt(jwt, key, options); | ||
export async function jwtDecrypt(jwt, key, options) { | ||
const decrypted = await compactDecrypt(jwt, key, options); | ||
const payload = jwtPayload(decrypted.protectedHeader, decrypted.plaintext, options); | ||
@@ -24,3 +24,1 @@ const { protectedHeader } = decrypted; | ||
} | ||
export { jwtDecrypt }; | ||
export default jwtDecrypt; |
@@ -1,5 +0,5 @@ | ||
import CompactEncrypt from '../jwe/compact/encrypt.js'; | ||
import { CompactEncrypt } from '../jwe/compact/encrypt.js'; | ||
import { encoder } from '../lib/buffer_utils.js'; | ||
import { ProduceJWT } from './produce.js'; | ||
class EncryptJWT extends ProduceJWT { | ||
export class EncryptJWT extends ProduceJWT { | ||
setProtectedHeader(protectedHeader) { | ||
@@ -69,3 +69,1 @@ if (this._protectedHeader) { | ||
} | ||
export { EncryptJWT }; | ||
export default EncryptJWT; |
@@ -1,6 +0,6 @@ | ||
import CompactSign from '../jws/compact/sign.js'; | ||
import { CompactSign } from '../jws/compact/sign.js'; | ||
import { JWTInvalid } from '../util/errors.js'; | ||
import { encoder } from '../lib/buffer_utils.js'; | ||
import { ProduceJWT } from './produce.js'; | ||
class SignJWT extends ProduceJWT { | ||
export class SignJWT extends ProduceJWT { | ||
setProtectedHeader(protectedHeader) { | ||
@@ -22,3 +22,1 @@ this._protectedHeader = protectedHeader; | ||
} | ||
export { SignJWT }; | ||
export default SignJWT; |
@@ -6,3 +6,3 @@ import * as base64url from '../runtime/base64url.js'; | ||
import { ProduceJWT } from './produce.js'; | ||
class UnsecuredJWT extends ProduceJWT { | ||
export class UnsecuredJWT extends ProduceJWT { | ||
encode() { | ||
@@ -34,3 +34,1 @@ const header = base64url.encode(JSON.stringify({ alg: 'none' })); | ||
} | ||
export { UnsecuredJWT }; | ||
export default UnsecuredJWT; |
@@ -1,7 +0,7 @@ | ||
import verify from '../jws/compact/verify.js'; | ||
import { compactVerify } from '../jws/compact/verify.js'; | ||
import jwtPayload from '../lib/jwt_claims_set.js'; | ||
import { JWTInvalid } from '../util/errors.js'; | ||
async function jwtVerify(jwt, key, options) { | ||
export async function jwtVerify(jwt, key, options) { | ||
var _a; | ||
const verified = await verify(jwt, key, options); | ||
const verified = await compactVerify(jwt, key, options); | ||
if (((_a = verified.protectedHeader.crit) === null || _a === void 0 ? void 0 : _a.includes('b64')) && verified.protectedHeader.b64 === false) { | ||
@@ -17,3 +17,1 @@ throw new JWTInvalid('JWTs MUST NOT use unencoded payload'); | ||
} | ||
export { jwtVerify }; | ||
export default jwtVerify; |
@@ -0,1 +1,2 @@ | ||
import { Buffer } from 'buffer'; | ||
import { createDecipheriv, createCipheriv } from 'crypto'; | ||
@@ -2,0 +3,0 @@ import { JOSENotSupported } from '../util/errors.js'; |
@@ -0,1 +1,2 @@ | ||
import { Buffer } from 'buffer'; | ||
import { JOSENotSupported } from '../util/errors.js'; | ||
@@ -2,0 +3,0 @@ const tagInteger = 0x02; |
import { createPrivateKey, createPublicKey } from 'crypto'; | ||
import { Buffer } from 'buffer'; | ||
import { isCryptoKey, getKeyObject } from './webcrypto.js'; | ||
@@ -3,0 +4,0 @@ import isKeyObject from './is_key_object.js'; |
@@ -0,1 +1,2 @@ | ||
import { Buffer } from 'buffer'; | ||
import { decoder } from '../lib/buffer_utils.js'; | ||
@@ -2,0 +3,0 @@ let encodeImpl; |
@@ -0,1 +1,2 @@ | ||
import { Buffer } from 'buffer'; | ||
import { createPublicKey } from 'crypto'; | ||
@@ -2,0 +3,0 @@ import { JOSENotSupported } from '../util/errors.js'; |
@@ -0,1 +1,2 @@ | ||
import { Buffer } from 'buffer'; | ||
import { createPrivateKey, createPublicKey, createSecretKey } from 'crypto'; | ||
@@ -2,0 +3,0 @@ import { decode as base64url } from './base64url.js'; |
import { decode as base64url } from './base64url.js'; | ||
import { decoder } from '../lib/buffer_utils.js'; | ||
import isObject from '../lib/is_object.js'; | ||
function decodeProtectedHeader(token) { | ||
export function decodeProtectedHeader(token) { | ||
let protectedB64u; | ||
@@ -35,3 +35,1 @@ if (typeof token === 'string') { | ||
} | ||
export { decodeProtectedHeader }; | ||
export default decodeProtectedHeader; |
import type { KeyLike, DecryptOptions, JWEHeaderParameters, GetKeyFunction, FlattenedJWE, CompactDecryptResult, ResolvedKey } from '../../types'; | ||
export interface CompactDecryptGetKey extends GetKeyFunction<JWEHeaderParameters, FlattenedJWE> { | ||
} | ||
declare function compactDecrypt(jwe: string | Uint8Array, key: KeyLike | Uint8Array, options?: DecryptOptions): Promise<CompactDecryptResult>; | ||
declare function compactDecrypt(jwe: string | Uint8Array, getKey: CompactDecryptGetKey, options?: DecryptOptions): Promise<CompactDecryptResult & ResolvedKey>; | ||
export { compactDecrypt }; | ||
export default compactDecrypt; | ||
export type { KeyLike, DecryptOptions, CompactDecryptResult }; | ||
export declare function compactDecrypt(jwe: string | Uint8Array, key: KeyLike | Uint8Array, options?: DecryptOptions): Promise<CompactDecryptResult>; | ||
export declare function compactDecrypt(jwe: string | Uint8Array, getKey: CompactDecryptGetKey, options?: DecryptOptions): Promise<CompactDecryptResult & ResolvedKey>; |
import type { KeyLike, JWEKeyManagementHeaderParameters, JWEHeaderParameters, EncryptOptions } from '../../types'; | ||
declare class CompactEncrypt { | ||
export declare class CompactEncrypt { | ||
private _flattened; | ||
@@ -11,4 +11,1 @@ constructor(plaintext: Uint8Array); | ||
} | ||
export { CompactEncrypt }; | ||
export default CompactEncrypt; | ||
export type { KeyLike, JWEKeyManagementHeaderParameters, JWEHeaderParameters }; |
import type { FlattenedDecryptResult, KeyLike, FlattenedJWE, JWEHeaderParameters, DecryptOptions, GetKeyFunction, ResolvedKey } from '../../types'; | ||
export interface FlattenedDecryptGetKey extends GetKeyFunction<JWEHeaderParameters | undefined, FlattenedJWE> { | ||
} | ||
declare function flattenedDecrypt(jwe: FlattenedJWE, key: KeyLike | Uint8Array, options?: DecryptOptions): Promise<FlattenedDecryptResult>; | ||
declare function flattenedDecrypt(jwe: FlattenedJWE, getKey: FlattenedDecryptGetKey, options?: DecryptOptions): Promise<FlattenedDecryptResult & ResolvedKey>; | ||
export { flattenedDecrypt }; | ||
export default flattenedDecrypt; | ||
export type { KeyLike, FlattenedJWE, JWEHeaderParameters, DecryptOptions, FlattenedDecryptResult }; | ||
export declare function flattenedDecrypt(jwe: FlattenedJWE, key: KeyLike | Uint8Array, options?: DecryptOptions): Promise<FlattenedDecryptResult>; | ||
export declare function flattenedDecrypt(jwe: FlattenedJWE, getKey: FlattenedDecryptGetKey, options?: DecryptOptions): Promise<FlattenedDecryptResult & ResolvedKey>; |
import type { KeyLike, FlattenedJWE, JWEHeaderParameters, JWEKeyManagementHeaderParameters, EncryptOptions } from '../../types'; | ||
declare class FlattenedEncrypt { | ||
export declare class FlattenedEncrypt { | ||
private _plaintext; | ||
@@ -21,4 +21,1 @@ private _protectedHeader; | ||
} | ||
export { FlattenedEncrypt }; | ||
export default FlattenedEncrypt; | ||
export type { KeyLike, FlattenedJWE, JWEHeaderParameters, JWEKeyManagementHeaderParameters }; |
import type { KeyLike, DecryptOptions, JWEHeaderParameters, GetKeyFunction, FlattenedJWE, GeneralJWE, GeneralDecryptResult, ResolvedKey } from '../../types'; | ||
export interface GeneralDecryptGetKey extends GetKeyFunction<JWEHeaderParameters, FlattenedJWE> { | ||
} | ||
declare function generalDecrypt(jwe: GeneralJWE, key: KeyLike | Uint8Array, options?: DecryptOptions): Promise<GeneralDecryptResult>; | ||
declare function generalDecrypt(jwe: GeneralJWE, getKey: GeneralDecryptGetKey, options?: DecryptOptions): Promise<GeneralDecryptResult & ResolvedKey>; | ||
export { generalDecrypt }; | ||
export default generalDecrypt; | ||
export type { KeyLike, GeneralJWE, DecryptOptions, GeneralDecryptResult }; | ||
export declare function generalDecrypt(jwe: GeneralJWE, key: KeyLike | Uint8Array, options?: DecryptOptions): Promise<GeneralDecryptResult>; | ||
export declare function generalDecrypt(jwe: GeneralJWE, getKey: GeneralDecryptGetKey, options?: DecryptOptions): Promise<GeneralDecryptResult & ResolvedKey>; |
import type { FlattenedJWSInput, JWSHeaderParameters } from '../types'; | ||
declare function EmbeddedJWK(protectedHeader: JWSHeaderParameters, token: FlattenedJWSInput): Promise<import("../types.d").KeyLike>; | ||
export { EmbeddedJWK }; | ||
export default EmbeddedJWK; | ||
export declare function EmbeddedJWK(protectedHeader: JWSHeaderParameters, token: FlattenedJWSInput): Promise<import("../types.d").KeyLike>; |
import type { JWK } from '../types'; | ||
declare function calculateThumbprint(jwk: JWK, digestAlgorithm?: 'sha256' | 'sha384' | 'sha512'): Promise<string>; | ||
export { calculateThumbprint }; | ||
export default calculateThumbprint; | ||
export type { JWK }; | ||
export declare function calculateJwkThumbprint(jwk: JWK, digestAlgorithm?: 'sha256' | 'sha384' | 'sha512'): Promise<string>; |
@@ -7,4 +7,2 @@ import type { JWSHeaderParameters, FlattenedJWSInput, GetKeyFunction } from '../types'; | ||
} | ||
declare function createRemoteJWKSet(url: URL, options?: RemoteJWKSetOptions): GetKeyFunction<JWSHeaderParameters, FlattenedJWSInput>; | ||
export { createRemoteJWKSet }; | ||
export default createRemoteJWKSet; | ||
export declare function createRemoteJWKSet(url: URL, options?: RemoteJWKSetOptions): GetKeyFunction<JWSHeaderParameters, FlattenedJWSInput>; |
import type { JWSHeaderParameters, KeyLike, SignOptions } from '../../types'; | ||
declare class CompactSign { | ||
export declare class CompactSign { | ||
private _flattened; | ||
@@ -8,4 +8,1 @@ constructor(payload: Uint8Array); | ||
} | ||
export { CompactSign }; | ||
export default CompactSign; | ||
export type { JWSHeaderParameters, KeyLike }; |
import type { CompactVerifyResult, FlattenedJWSInput, GetKeyFunction, JWSHeaderParameters, KeyLike, VerifyOptions, ResolvedKey } from '../../types'; | ||
export interface CompactVerifyGetKey extends GetKeyFunction<JWSHeaderParameters, FlattenedJWSInput> { | ||
} | ||
declare function compactVerify(jws: string | Uint8Array, key: KeyLike | Uint8Array, options?: VerifyOptions): Promise<CompactVerifyResult>; | ||
declare function compactVerify(jws: string | Uint8Array, getKey: CompactVerifyGetKey, options?: VerifyOptions): Promise<CompactVerifyResult & ResolvedKey>; | ||
export { compactVerify }; | ||
export default compactVerify; | ||
export type { KeyLike, VerifyOptions, CompactVerifyResult }; | ||
export declare function compactVerify(jws: string | Uint8Array, key: KeyLike | Uint8Array, options?: VerifyOptions): Promise<CompactVerifyResult>; | ||
export declare function compactVerify(jws: string | Uint8Array, getKey: CompactVerifyGetKey, options?: VerifyOptions): Promise<CompactVerifyResult & ResolvedKey>; |
import type { KeyLike, FlattenedJWS, JWSHeaderParameters, SignOptions } from '../../types'; | ||
declare class FlattenedSign { | ||
export declare class FlattenedSign { | ||
private _payload; | ||
@@ -11,4 +11,1 @@ private _protectedHeader; | ||
} | ||
export { FlattenedSign }; | ||
export default FlattenedSign; | ||
export type { KeyLike, FlattenedJWS, JWSHeaderParameters }; |
import type { FlattenedVerifyResult, KeyLike, FlattenedJWSInput, JWSHeaderParameters, VerifyOptions, GetKeyFunction, ResolvedKey } from '../../types'; | ||
export interface FlattenedVerifyGetKey extends GetKeyFunction<JWSHeaderParameters | undefined, FlattenedJWSInput> { | ||
} | ||
declare function flattenedVerify(jws: FlattenedJWSInput, key: KeyLike | Uint8Array, options?: VerifyOptions): Promise<FlattenedVerifyResult>; | ||
declare function flattenedVerify(jws: FlattenedJWSInput, getKey: FlattenedVerifyGetKey, options?: VerifyOptions): Promise<FlattenedVerifyResult & ResolvedKey>; | ||
export { flattenedVerify }; | ||
export default flattenedVerify; | ||
export type { KeyLike, FlattenedJWSInput, GetKeyFunction, JWSHeaderParameters, VerifyOptions, FlattenedVerifyResult, }; | ||
export declare function flattenedVerify(jws: FlattenedJWSInput, key: KeyLike | Uint8Array, options?: VerifyOptions): Promise<FlattenedVerifyResult>; | ||
export declare function flattenedVerify(jws: FlattenedJWSInput, getKey: FlattenedVerifyGetKey, options?: VerifyOptions): Promise<FlattenedVerifyResult & ResolvedKey>; |
@@ -6,3 +6,3 @@ import type { KeyLike, GeneralJWS, JWSHeaderParameters, SignOptions } from '../../types'; | ||
} | ||
declare class GeneralSign { | ||
export declare class GeneralSign { | ||
private _payload; | ||
@@ -14,4 +14,1 @@ private _signatures; | ||
} | ||
export { GeneralSign }; | ||
export default GeneralSign; | ||
export type { KeyLike, GeneralJWS, JWSHeaderParameters }; |
import type { GeneralJWSInput, GeneralVerifyResult, FlattenedJWSInput, GetKeyFunction, JWSHeaderParameters, KeyLike, VerifyOptions, ResolvedKey } from '../../types'; | ||
export interface GeneralVerifyGetKey extends GetKeyFunction<JWSHeaderParameters, FlattenedJWSInput> { | ||
} | ||
declare function generalVerify(jws: GeneralJWSInput, key: KeyLike | Uint8Array, options?: VerifyOptions): Promise<GeneralVerifyResult>; | ||
declare function generalVerify(jws: GeneralJWSInput, getKey: GeneralVerifyGetKey, options?: VerifyOptions): Promise<GeneralVerifyResult & ResolvedKey>; | ||
export { generalVerify }; | ||
export default generalVerify; | ||
export type { KeyLike, GeneralJWSInput, VerifyOptions, GeneralVerifyResult }; | ||
export declare function generalVerify(jws: GeneralJWSInput, key: KeyLike | Uint8Array, options?: VerifyOptions): Promise<GeneralVerifyResult>; | ||
export declare function generalVerify(jws: GeneralJWSInput, getKey: GeneralVerifyGetKey, options?: VerifyOptions): Promise<GeneralVerifyResult & ResolvedKey>; |
@@ -1,10 +0,7 @@ | ||
import type { KeyLike, DecryptOptions, JWTPayload, JWTClaimVerificationOptions, GetKeyFunction, JWEHeaderParameters, FlattenedJWE, JWTDecryptResult, ResolvedKey } from '../types'; | ||
interface JWTDecryptOptions extends DecryptOptions, JWTClaimVerificationOptions { | ||
import type { KeyLike, DecryptOptions, JWTClaimVerificationOptions, GetKeyFunction, JWEHeaderParameters, FlattenedJWE, JWTDecryptResult, ResolvedKey } from '../types'; | ||
export interface JWTDecryptOptions extends DecryptOptions, JWTClaimVerificationOptions { | ||
} | ||
export interface JWTDecryptGetKey extends GetKeyFunction<JWEHeaderParameters, FlattenedJWE> { | ||
} | ||
declare function jwtDecrypt(jwt: string | Uint8Array, key: KeyLike | Uint8Array, options?: JWTDecryptOptions): Promise<JWTDecryptResult>; | ||
declare function jwtDecrypt(jwt: string | Uint8Array, getKey: JWTDecryptGetKey, options?: JWTDecryptOptions): Promise<JWTDecryptResult & ResolvedKey>; | ||
export { jwtDecrypt }; | ||
export default jwtDecrypt; | ||
export type { KeyLike, DecryptOptions, JWTPayload, JWTDecryptOptions, JWTDecryptResult }; | ||
export declare function jwtDecrypt(jwt: string | Uint8Array, key: KeyLike | Uint8Array, options?: JWTDecryptOptions): Promise<JWTDecryptResult>; | ||
export declare function jwtDecrypt(jwt: string | Uint8Array, getKey: JWTDecryptGetKey, options?: JWTDecryptOptions): Promise<JWTDecryptResult & ResolvedKey>; |
@@ -1,4 +0,4 @@ | ||
import type { EncryptOptions, JWEHeaderParameters, JWEKeyManagementHeaderParameters, JWTPayload, KeyLike } from '../types'; | ||
import type { EncryptOptions, JWEHeaderParameters, JWEKeyManagementHeaderParameters, KeyLike } from '../types'; | ||
import { ProduceJWT } from './produce'; | ||
declare class EncryptJWT extends ProduceJWT { | ||
export declare class EncryptJWT extends ProduceJWT { | ||
private _cek; | ||
@@ -20,4 +20,1 @@ private _iv; | ||
} | ||
export { EncryptJWT }; | ||
export default EncryptJWT; | ||
export type { JWEHeaderParameters, JWTPayload, KeyLike }; |
@@ -1,4 +0,4 @@ | ||
import type { JWSHeaderParameters, JWTPayload, KeyLike, SignOptions } from '../types'; | ||
import type { JWSHeaderParameters, KeyLike, SignOptions } from '../types'; | ||
import { ProduceJWT } from './produce'; | ||
declare class SignJWT extends ProduceJWT { | ||
export declare class SignJWT extends ProduceJWT { | ||
private _protectedHeader; | ||
@@ -8,4 +8,1 @@ setProtectedHeader(protectedHeader: JWSHeaderParameters): this; | ||
} | ||
export { SignJWT }; | ||
export default SignJWT; | ||
export type { JWSHeaderParameters, JWTPayload, KeyLike }; |
import type { JWSHeaderParameters, JWTClaimVerificationOptions, JWTPayload } from '../types'; | ||
import { ProduceJWT } from './produce'; | ||
interface UnsecuredResult { | ||
export interface UnsecuredResult { | ||
payload: JWTPayload; | ||
header: JWSHeaderParameters; | ||
} | ||
declare class UnsecuredJWT extends ProduceJWT { | ||
export declare class UnsecuredJWT extends ProduceJWT { | ||
encode(): string; | ||
static decode(jwt: string, options?: JWTClaimVerificationOptions): UnsecuredResult; | ||
} | ||
export { UnsecuredJWT }; | ||
export default UnsecuredJWT; | ||
export type { JWSHeaderParameters, JWTPayload, UnsecuredResult }; |
@@ -1,10 +0,7 @@ | ||
import type { KeyLike, VerifyOptions, JWTPayload, JWTClaimVerificationOptions, JWSHeaderParameters, GetKeyFunction, FlattenedJWSInput, JWTVerifyResult, ResolvedKey } from '../types'; | ||
interface JWTVerifyOptions extends VerifyOptions, JWTClaimVerificationOptions { | ||
import type { KeyLike, VerifyOptions, JWTClaimVerificationOptions, JWSHeaderParameters, GetKeyFunction, FlattenedJWSInput, JWTVerifyResult, ResolvedKey } from '../types'; | ||
export interface JWTVerifyOptions extends VerifyOptions, JWTClaimVerificationOptions { | ||
} | ||
export interface JWTVerifyGetKey extends GetKeyFunction<JWSHeaderParameters, FlattenedJWSInput> { | ||
} | ||
declare function jwtVerify(jwt: string | Uint8Array, key: KeyLike | Uint8Array, options?: JWTVerifyOptions): Promise<JWTVerifyResult>; | ||
declare function jwtVerify(jwt: string | Uint8Array, getKey: JWTVerifyGetKey, options?: JWTVerifyOptions): Promise<JWTVerifyResult & ResolvedKey>; | ||
export { jwtVerify }; | ||
export default jwtVerify; | ||
export type { KeyLike, JWTPayload, JWTVerifyOptions, JWSHeaderParameters, GetKeyFunction, JWTVerifyResult, }; | ||
export declare function jwtVerify(jwt: string | Uint8Array, key: KeyLike | Uint8Array, options?: JWTVerifyOptions): Promise<JWTVerifyResult>; | ||
export declare function jwtVerify(jwt: string | Uint8Array, getKey: JWTVerifyGetKey, options?: JWTVerifyOptions): Promise<JWTVerifyResult & ResolvedKey>; |
@@ -5,2 +5,1 @@ import type { JWK, KeyLike } from '../types'; | ||
export declare function exportJWK(key: KeyLike | Uint8Array): Promise<JWK>; | ||
export type { KeyLike, JWK }; |
@@ -9,2 +9,1 @@ import type { JWK, KeyLike } from '../types'; | ||
export declare function importJWK(jwk: JWK, alg?: string, octAsKeyObject?: boolean): Promise<KeyLike | Uint8Array>; | ||
export type { KeyLike, JWK }; |
@@ -10,3 +10,3 @@ /** | ||
* | ||
* [jose/key/import](../modules/key_import.md#readme) functions can be used to import PEM, | ||
* [Key Import Functions](../modules/key_import.md#readme) can be used to import PEM, | ||
* or JWK formatted asymmetric keys and certificates to these runtime-specific representations. | ||
@@ -39,3 +39,3 @@ * | ||
* ```js | ||
* import { importSPKI } from 'jose/key/import' | ||
* import { importSPKI } from 'jose' | ||
* | ||
@@ -52,3 +52,3 @@ * const algorithm = 'ES256' | ||
* ```js | ||
* import { importX509 } from 'jose/key/import' | ||
* import { importX509 } from 'jose' | ||
* | ||
@@ -71,3 +71,3 @@ * const algorithm = 'ES256' | ||
* ```js | ||
* import { importPKCS8 } from 'jose/key/import' | ||
* import { importPKCS8 } from 'jose' | ||
* | ||
@@ -85,3 +85,3 @@ * const algorithm = 'ES256' | ||
* ```js | ||
* import { importJWK } from 'jose/key/import' | ||
* import { importJWK } from 'jose' | ||
* | ||
@@ -88,0 +88,0 @@ * const ecPublicKey = await importJWK({ |
import type { JWSHeaderParameters, JWEHeaderParameters } from '../types'; | ||
export declare type ProtectedHeaderParameters = JWSHeaderParameters & JWEHeaderParameters; | ||
declare function decodeProtectedHeader(token: string | object): ProtectedHeaderParameters; | ||
export { decodeProtectedHeader }; | ||
export default decodeProtectedHeader; | ||
export declare function decodeProtectedHeader(token: string | object): ProtectedHeaderParameters; |
{ | ||
"name": "jose-node-esm-runtime", | ||
"version": "3.20.3", | ||
"description": "(Node.JS ESM Runtime) 'JSON Web Almost Everything' - JWA, JWS, JWE, JWT, JWK with no dependencies", | ||
"version": "4.0.0", | ||
"description": "(Node.JS ESM Runtime) 'JSON Web Almost Everything' - JWA, JWS, JWE, JWT, JWK, JWKS with no dependencies using runtime's native crypto", | ||
"keywords": [ | ||
@@ -50,40 +50,9 @@ "compact", | ||
"exports": { | ||
"./package.json": "./package.json", | ||
"./jwe/compact/decrypt": "./dist/node/esm/jwe/compact/decrypt.js", | ||
"./jwe/compact/encrypt": "./dist/node/esm/jwe/compact/encrypt.js", | ||
"./jwe/flattened/decrypt": "./dist/node/esm/jwe/flattened/decrypt.js", | ||
"./jwe/flattened/encrypt": "./dist/node/esm/jwe/flattened/encrypt.js", | ||
"./jwe/general/decrypt": "./dist/node/esm/jwe/general/decrypt.js", | ||
"./jwk/embedded": "./dist/node/esm/jwk/embedded.js", | ||
"./jwk/from_key_like": "./dist/node/esm/jwk/from_key_like.js", | ||
"./jwk/parse": "./dist/node/esm/jwk/parse.js", | ||
"./jwk/thumbprint": "./dist/node/esm/jwk/thumbprint.js", | ||
"./jwks/remote": "./dist/node/esm/jwks/remote.js", | ||
"./jws/compact/sign": "./dist/node/esm/jws/compact/sign.js", | ||
"./jws/compact/verify": "./dist/node/esm/jws/compact/verify.js", | ||
"./jws/flattened/sign": "./dist/node/esm/jws/flattened/sign.js", | ||
"./jws/flattened/verify": "./dist/node/esm/jws/flattened/verify.js", | ||
"./jws/general/sign": "./dist/node/esm/jws/general/sign.js", | ||
"./jws/general/verify": "./dist/node/esm/jws/general/verify.js", | ||
"./jwt/decrypt": "./dist/node/esm/jwt/decrypt.js", | ||
"./jwt/encrypt": "./dist/node/esm/jwt/encrypt.js", | ||
"./jwt/sign": "./dist/node/esm/jwt/sign.js", | ||
"./jwt/unsecured": "./dist/node/esm/jwt/unsecured.js", | ||
"./jwt/verify": "./dist/node/esm/jwt/verify.js", | ||
"./key/export": "./dist/node/esm/key/export.js", | ||
"./key/import": "./dist/node/esm/key/import.js", | ||
"./util/base64url": "./dist/node/esm/util/base64url.js", | ||
"./util/decode_protected_header": "./dist/node/esm/util/decode_protected_header.js", | ||
"./util/errors": "./dist/node/esm/util/errors.js", | ||
"./util/generate_key_pair": "./dist/node/esm/util/generate_key_pair.js", | ||
"./util/generate_secret": "./dist/node/esm/util/generate_secret.js", | ||
"./util/random": "./dist/node/esm/util/random.js" | ||
".": { | ||
"import": "./dist/node/esm/index.js" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"typesVersions": { | ||
"*": { | ||
"*": [ | ||
"./dist/types/*" | ||
] | ||
} | ||
}, | ||
"main": "./dist/node/cjs/index.js", | ||
"types": "./dist/types/index.d.ts", | ||
"files": [ | ||
@@ -90,0 +59,0 @@ "dist/**/package.json", |
# jose | ||
> (Node.JS ESM Runtime) 'JSON Web Almost Everything' - JWA, JWS, JWE, JWT, JWK with no dependencies using the Node.js `crypto` module. | ||
> (Node.JS ESM Runtime) 'JSON Web Almost Everything' - JWA, JWS, JWE, JWT, JWK, JWKS with no dependencies using runtime's native crypto using the Node.js `crypto` module. | ||
@@ -5,0 +5,0 @@ ⚠️ This distribution only supports the Node.js runtime. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
165923
111
4188