We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9e763ac commit e21fea1Copy full SHA for e21fea1
README.md
@@ -43,7 +43,7 @@ Legend:
43
| -- | -- | -- |
44
| RSASSA-PKCS1-v1_5 | ✓ | RS256, RS384, RS512 |
45
| RSASSA-PSS | ✓ | PS256, PS384, PS512 |
46
-| ECDSA | ✓ | ES256, ES256K, ES384, ES512 |
+| ECDSA | ✓ | ES256, ES384, ES512 |
47
| HMAC with SHA-2 | ✓ | HS256, HS384, HS512 |
48
49
| JWE Key Management Algorithms | Supported ||
lib/help/ecdsa_signatures.js
@@ -10,7 +10,6 @@ const getParamSize = keySize => ((keySize / 8) | 0) + (keySize % 8 === 0 ? 0 : 1
10
11
const paramBytesForAlg = {
12
ES256: getParamSize(256),
13
- ES256K: getParamSize(256),
14
ES384: getParamSize(384),
15
ES512: getParamSize(521)
16
}
lib/help/key_utils.js
@@ -2,24 +2,21 @@ const base64url = require('./base64url')
2
const errors = require('../errors')
3
const asn1 = require('./asn1')
4
5
-const EC_CURVES = new Set(['P-256', 'P-256K', 'P-384', 'P-521'])
+const EC_CURVES = new Set(['P-256', 'P-384', 'P-521'])
6
7
const oidHexToCurve = new Map([
8
['06082a8648ce3d030107', 'P-256'],
9
- ['06052b8104000a', 'P-256K'],
['06052b81040022', 'P-384'],
['06052b81040023', 'P-521']
])
const EC_KEY_OID = '1.2.840.10045.2.1'.split('.')
const crvToOid = new Map([
['P-256', '1.2.840.10045.3.1.7'.split('.')],
- ['P-256K', '1.3.132.0.10'.split('.')],
17
['P-384', '1.3.132.0.34'.split('.')],
18
['P-521', '1.3.132.0.35'.split('.')]
19
20
const crvToOidBuf = new Map([
21
['P-256', Buffer.from('06082a8648ce3d030107', 'hex')],
22
- ['P-256K', Buffer.from('06052b8104000a', 'hex')],
23
['P-384', Buffer.from('06052b81040022', 'hex')],
24
['P-521', Buffer.from('06052b81040023', 'hex')]
25
lib/help/node_alg.js
@@ -4,7 +4,6 @@ module.exports = (alg) => {
case 'PS256':
case 'HS256':
case 'ES256':
- case 'ES256K':
return 'sha256'
case 'RS384':
case 'PS384':
lib/index.d.ts
@@ -8,7 +8,7 @@ interface KeyParameters {
use?: use
kid?: string
-type curve = 'P-256' | 'P-256K' | 'P-384' | 'P-521'
+type curve = 'P-256' | 'P-384' | 'P-521'
type keyType = 'RSA' | 'EC' | 'oct'
type keyOperation = 'encrypt' | 'decrypt' | 'sign' | 'verify' | 'wrapKey' | 'unwrapKey'
type asymmetricKeyObjectTypes = 'private' | 'public'
lib/jwa/ecdh/derive.js
@@ -6,8 +6,6 @@ const crvToCurve = (crv) => {
switch (crv) {
case 'P-256':
return 'prime256v1'
- case 'P-256K':
- return 'secp256k1'
case 'P-384':
return 'secp384r1'
case 'P-521':
lib/jwa/ecdsa.js
@@ -23,7 +23,7 @@ const verify = (jwaAlg, nodeAlg, { [KEYOBJECT]: keyObject }, payload, signature)
module.exports = (JWA) => {
26
- ['ES256', 'ES384', 'ES512', 'ES256K'].forEach((jwaAlg) => {
+ ['ES256', 'ES384', 'ES512'].forEach((jwaAlg) => {
27
const nodeAlg = resolveNodeAlg(jwaAlg)
28
29
assert(!JWA.sign.has(jwaAlg), `sign alg ${jwaAlg} already registered`)
lib/jwk/key/ec.js
@@ -3,7 +3,7 @@ const { promisify } = require('util')
const { THUMBPRINT_MATERIAL, PUBLIC_MEMBERS, PRIVATE_MEMBERS, JWK_MEMBERS } = require('../../help/symbols')
const errors = require('../../errors')
const Key = require('./base')
@@ -20,8 +20,6 @@ const crvToDSA = (crv) => {
return 'ES256'
- return 'ES256K'
return 'ES384'
@@ -104,9 +102,6 @@ class ECKey extends Key {
104
102
throw new errors.JOSENotSupported(`unsupported EC key curve: ${crv}`)
105
103
106
107
- if (crv === 'P-256K') {
108
- crv = 'secp256k1'
109
- }
110
const { privateKey, publicKey } = await generateKeyPair('ec', { namedCurve: crv })
111
112
return privat ? privateKey : publicKey
@@ -117,9 +112,6 @@ class ECKey extends Key {
117
118
113
119
114
120
121
122
123
115
const { privateKey, publicKey } = generateKeyPairSync('ec', { namedCurve: crv })
124
116
125
package.json
@@ -16,7 +16,6 @@
"jwks",
"jws",
"jwt",
- "secp256k1",
"sign",
"verify"
],
test/fixtures/P-256K.key
0 commit comments