Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jose-node-esm-runtime

Package Overview
Dependencies
Maintainers
0
Versions
132
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jose-node-esm-runtime - npm Package Compare versions

Comparing version 5.5.0 to 5.6.0

dist/node/esm/runtime/normalize_key.js

2

dist/node/esm/jwks/remote.js

@@ -13,3 +13,3 @@ import fetchJwks from '../runtime/fetch_jwks.js';

const NAME = 'jose';
const VERSION = 'v5.5.0';
const VERSION = 'v5.6.0';
USER_AGENT = `${NAME}/${VERSION}`;

@@ -16,0 +16,0 @@ }

import { withAlg as invalidKeyInput } from './invalid_key_input.js';
import isKeyLike, { types } from '../runtime/is_key_like.js';
const tag = (key) => key?.[Symbol.toStringTag];
const symmetricTypeCheck = (alg, key) => {

@@ -10,3 +11,3 @@ if (key instanceof Uint8Array)

if (key.type !== 'secret') {
throw new TypeError(`${types.join(' or ')} instances for symmetric algorithms must be of type "secret"`);
throw new TypeError(`${tag(key)} instances for symmetric algorithms must be of type "secret"`);
}

@@ -19,15 +20,15 @@ };

if (key.type === 'secret') {
throw new TypeError(`${types.join(' or ')} instances for asymmetric algorithms must not be of type "secret"`);
throw new TypeError(`${tag(key)} instances for asymmetric algorithms must not be of type "secret"`);
}
if (usage === 'sign' && key.type === 'public') {
throw new TypeError(`${types.join(' or ')} instances for asymmetric algorithm signing must be of type "private"`);
throw new TypeError(`${tag(key)} instances for asymmetric algorithm signing must be of type "private"`);
}
if (usage === 'decrypt' && key.type === 'public') {
throw new TypeError(`${types.join(' or ')} instances for asymmetric algorithm decryption must be of type "private"`);
throw new TypeError(`${tag(key)} instances for asymmetric algorithm decryption must be of type "private"`);
}
if (key.algorithm && usage === 'verify' && key.type === 'private') {
throw new TypeError(`${types.join(' or ')} instances for asymmetric algorithm verifying must be of type "public"`);
throw new TypeError(`${tag(key)} instances for asymmetric algorithm verifying must be of type "public"`);
}
if (key.algorithm && usage === 'encrypt' && key.type === 'private') {
throw new TypeError(`${types.join(' or ')} instances for asymmetric algorithm encryption must be of type "public"`);
throw new TypeError(`${tag(key)} instances for asymmetric algorithm encryption must be of type "public"`);
}

@@ -34,0 +35,0 @@ };

@@ -6,2 +6,3 @@ import { unwrap as aesKw } from '../runtime/aeskw.js';

import { decode as base64url } from '../runtime/base64url.js';
import * as normalize from '../runtime/normalize_key.js';
import { JOSENotSupported, JWEInvalid } from '../util/errors.js';

@@ -14,2 +15,5 @@ import { bitLength as cekLength } from '../lib/cek.js';

async function decryptKeyManagement(alg, key, encryptedKey, joseHeader, options) {
if (normalize.normalizePrivateKey) {
key = await normalize.normalizePrivateKey(key, alg);
}
checkKeyType(alg, key, 'decrypt');

@@ -16,0 +20,0 @@ switch (alg) {

@@ -6,2 +6,3 @@ import { wrap as aesKw } from '../runtime/aeskw.js';

import { encode as base64url } from '../runtime/base64url.js';
import * as normalize from '../runtime/normalize_key.js';
import generateCek, { bitLength as cekLength } from '../lib/cek.js';

@@ -16,2 +17,5 @@ import { JOSENotSupported } from '../util/errors.js';

let cek;
if (normalize.normalizePublicKey) {
key = await normalize.normalizePublicKey(key, alg);
}
checkKeyType(alg, key, 'encrypt');

@@ -18,0 +22,0 @@ switch (alg) {

{
"name": "jose-node-esm-runtime",
"version": "5.5.0",
"version": "5.6.0",
"homepage": "https://github.com/panva/jose",

@@ -5,0 +5,0 @@ "repository": "panva/jose",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc