jose/dist/browser/runtime/check_cek_length.js
2021-10-18 14:06:42 +02:00

7 lines
243 B
JavaScript

import { JWEInvalid } from '../util/errors.js';
const checkCekLength = (cek, expected) => {
if (cek.length << 3 !== expected) {
throw new JWEInvalid('Invalid Content Encryption Key length');
}
};
export default checkCekLength;