mirror of
https://github.com/hanzoai/jose.git
synced 2026-09-24 17:00:01 +00:00
16 lines
384 B
TypeScript
16 lines
384 B
TypeScript
import { JOSENotSupported } from '../util/errors.ts'
|
|
|
|
export default function subtleRsaEs(alg: string) {
|
|
switch (alg) {
|
|
case 'RSA-OAEP':
|
|
case 'RSA-OAEP-256':
|
|
case 'RSA-OAEP-384':
|
|
case 'RSA-OAEP-512':
|
|
return 'RSA-OAEP'
|
|
default:
|
|
throw new JOSENotSupported(
|
|
`alg ${alg} is not supported either by JOSE or your javascript runtime`,
|
|
)
|
|
}
|
|
}
|