Files
Webklar.com/node_modules/jose/dist/browser/runtime/check_cek_length.js
Basilosaurusrex f027651f9b main repo
2025-11-24 18:09:40 +01:00

9 lines
321 B
JavaScript

import { JWEInvalid } from '../util/errors.js';
const checkCekLength = (cek, expected) => {
const actual = cek.byteLength << 3;
if (actual !== expected) {
throw new JWEInvalid(`Invalid Content Encryption Key length. Expected ${expected} bits, got ${actual} bits`);
}
};
export default checkCekLength;