mirror of
https://github.com/danbulant/jose
synced 2026-05-24 20:41:46 +00:00
8 lines
324 B
JavaScript
8 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`);
|
|
}
|
|
}
|
|
};
|