jose/lib/help/node_alg.js
Filip Skokan e21fea106b revert: add EC P-256K JWK and ES256K sign/verify support
BREAKING CHANGE: removing ES256K alg and EC P-256K crv support until the
IETF WG decides on what the final names will be.
2019-04-07 14:13:10 +02:00

19 lines
333 B
JavaScript

module.exports = (alg) => {
switch (alg) {
case 'RS256':
case 'PS256':
case 'HS256':
case 'ES256':
return 'sha256'
case 'RS384':
case 'PS384':
case 'HS384':
case 'ES384':
return 'sha384'
case 'RS512':
case 'PS512':
case 'HS512':
case 'ES512':
return 'sha512'
}
}