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

9 lines
324 B
JavaScript

export default (alg, key) => {
if (alg.startsWith('RS') || alg.startsWith('PS')) {
const { modulusLength } = key.algorithm;
if (typeof modulusLength !== 'number' || modulusLength < 2048) {
throw new TypeError(`${alg} requires key modulusLength to be 2048 bits or larger`);
}
}
};