subtle_rsaes.js 397 B

123456789101112
  1. import { JOSENotSupported } from '../util/errors.js';
  2. export default function subtleRsaEs(alg) {
  3. switch (alg) {
  4. case 'RSA-OAEP':
  5. case 'RSA-OAEP-256':
  6. case 'RSA-OAEP-384':
  7. case 'RSA-OAEP-512':
  8. return 'RSA-OAEP';
  9. default:
  10. throw new JOSENotSupported(`alg ${alg} is not supported either by JOSE or your javascript runtime`);
  11. }
  12. }