Skip to main content
Module

x/jose/runtime/check_cek_length.ts

"JSON Web Almost Everything" - JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes.
Extremely Popular
Go to Latest
File
import { JWEInvalid } from '../util/errors.ts'
const checkCekLength = (cek: Uint8Array, expected: number) => { 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