astro-ghostcms/.pnpm-store/v3/files/a2/38fa9933bd4e1a24f87ed48898e...

9 lines
324 B
Plaintext
Raw Normal View History

2024-02-14 14:10:47 +00:00
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`);
}
}
};