jose-browser-runtime
Advanced tools
Comparing version 4.5.0 to 4.5.1
@@ -15,2 +15,7 @@ import digest from '../runtime/digest.js'; | ||
} | ||
if (digestAlgorithm !== 'sha256' && | ||
digestAlgorithm !== 'sha384' && | ||
digestAlgorithm !== 'sha512') { | ||
throw new TypeError('digestAlgorithm must one of "sha256", "sha384", or "sha512"'); | ||
} | ||
let components; | ||
@@ -17,0 +22,0 @@ switch (jwk.kty) { |
@@ -0,1 +1,2 @@ | ||
import digest from '../runtime/digest.js'; | ||
export const encoder = new TextEncoder(); | ||
@@ -39,3 +40,3 @@ export const decoder = new TextDecoder(); | ||
} | ||
export async function concatKdf(digest, secret, bits, value) { | ||
export async function concatKdf(secret, bits, value) { | ||
const iterations = Math.ceil((bits >> 3) / 32); | ||
@@ -42,0 +43,0 @@ let res; |
import { encoder, concat, uint32be, lengthAndInput, concatKdf } from '../lib/buffer_utils.js'; | ||
import crypto, { isCryptoKey } from './webcrypto.js'; | ||
import { checkEncCryptoKey } from '../lib/crypto_key.js'; | ||
import digest from './digest.js'; | ||
import invalidKeyInput from '../lib/invalid_key_input.js'; | ||
@@ -24,3 +23,3 @@ import { types } from './is_key_like.js'; | ||
}, privateKey, Math.ceil(parseInt(privateKey.algorithm.namedCurve.slice(-3), 10) / 8) << 3)); | ||
return concatKdf(digest, sharedSecret, keyLength, value); | ||
return concatKdf(sharedSecret, keyLength, value); | ||
} | ||
@@ -27,0 +26,0 @@ export async function generateEpk(key) { |
@@ -121,3 +121,3 @@ /** | ||
export interface GetKeyFunction<T, T2> { | ||
(protectedHeader: T, token: T2): Promise<KeyLike | Uint8Array> | ||
(protectedHeader: T, token: T2): Promise<KeyLike | Uint8Array> | KeyLike | Uint8Array | ||
} | ||
@@ -124,0 +124,0 @@ export interface FlattenedJWSInput { |
{ | ||
"name": "jose-browser-runtime", | ||
"version": "4.5.0", | ||
"version": "4.5.1", | ||
"homepage": "https://github.com/panva/jose", | ||
@@ -5,0 +5,0 @@ "repository": "panva/jose", |
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
163504
4072