mirror of
https://github.com/hanzoai/jose.git
synced 2026-09-24 17:00:01 +00:00
BREAKING CHANGE: deprecated method `JWK.importKey` was removed BREAKING CHANGE: deprecated method `JWKS.KeyStore.fromJWKS` was removed BREAKING CHANGE: the use of unregistered curve name P-256K for secp256k1 was removed
22 lines
360 B
JavaScript
22 lines
360 B
JavaScript
const { getCurves } = require('crypto')
|
|
|
|
const curves = new Set()
|
|
|
|
if (getCurves().includes('prime256v1')) {
|
|
curves.add('P-256')
|
|
}
|
|
|
|
if (getCurves().includes('secp256k1')) {
|
|
curves.add('secp256k1')
|
|
}
|
|
|
|
if (getCurves().includes('secp384r1')) {
|
|
curves.add('P-384')
|
|
}
|
|
|
|
if (getCurves().includes('secp521r1')) {
|
|
curves.add('P-521')
|
|
}
|
|
|
|
module.exports = curves
|