jose/dist/browser/runtime/check_cek_length.js
2021-11-11 23:31:14 +01: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;