Skip to main content
Module

x/jose/runtime/check_key_length.ts

"JSON Web Almost Everything" - JWA, JWS, JWE, JWT, JWK, JWKS with no dependencies using runtime's native crypto in Node.js, Browser, Cloudflare Workers, Electron, and Deno.
Extremely Popular
Go to Latest
File
export default (alg: string, key: CryptoKey) => { if (alg.startsWith('RS') || alg.startsWith('PS')) { const { modulusLength } = <RsaKeyAlgorithm>key.algorithm if (typeof modulusLength !== 'number' || modulusLength < 2048) { throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`) } }}