@@ -152,7 +152,6 @@ const {
152
152
153
153
const kAsymmetricKeyType = Symbol ( 'kAsymmetricKeyType' ) ;
154
154
const kAsymmetricKeyDetails = Symbol ( 'kAsymmetricKeyDetails' ) ;
155
- const kAsymmetricKeyJWKProperties = Symbol ( 'kAsymmetricKeyJWKProperties' ) ;
156
155
157
156
function normalizeKeyDetails ( details = { } ) {
158
157
if ( details . publicExponent !== undefined ) {
@@ -190,28 +189,6 @@ const {
190
189
return { } ;
191
190
}
192
191
}
193
-
194
- [ kAsymmetricKeyJWKProperties ] ( ) {
195
- switch ( this . asymmetricKeyType ) {
196
- case 'rsa' : return { } ;
197
- case 'ec' :
198
- switch ( this . asymmetricKeyDetails . namedCurve ) {
199
- case 'prime256v1' : return { crv : 'P-256' } ;
200
- case 'secp256k1' : return { crv : 'secp256k1' } ;
201
- case 'secp384r1' : return { crv : 'P-384' } ;
202
- case 'secp521r1' : return { crv : 'P-521' } ;
203
- default :
204
- throw new ERR_CRYPTO_JWK_UNSUPPORTED_CURVE (
205
- this . asymmetricKeyDetails . namedCurve ) ;
206
- }
207
- case 'ed25519' : return { crv : 'Ed25519' } ;
208
- case 'ed448' : return { crv : 'Ed448' } ;
209
- case 'x25519' : return { crv : 'X25519' } ;
210
- case 'x448' : return { crv : 'X448' } ;
211
- default :
212
- throw new ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE ( ) ;
213
- }
214
- }
215
192
}
216
193
217
194
class PublicKeyObject extends AsymmetricKeyObject {
@@ -221,8 +198,7 @@ const {
221
198
222
199
export ( options ) {
223
200
if ( options && options . format === 'jwk' ) {
224
- const properties = this [ kAsymmetricKeyJWKProperties ] ( ) ;
225
- return this [ kHandle ] . exportJwk ( properties ) ;
201
+ return this [ kHandle ] . exportJwk ( { } ) ;
226
202
}
227
203
const {
228
204
format,
@@ -243,8 +219,7 @@ const {
243
219
throw new ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS (
244
220
'jwk' , 'does not support encryption' ) ;
245
221
}
246
- const properties = this [ kAsymmetricKeyJWKProperties ] ( ) ;
247
- return this [ kHandle ] . exportJwk ( properties ) ;
222
+ return this [ kHandle ] . exportJwk ( { } ) ;
248
223
}
249
224
const {
250
225
format,
0 commit comments