1'use strict'; 2 3const common = require('../common'); 4if (!common.hasCrypto) 5 common.skip('missing crypto'); 6 7const assert = require('assert'); 8 9const { 10 generateKeyPairSync, 11} = require('crypto'); 12 13{ 14 assert.throws(() => generateKeyPairSync('ec', { 15 namedCurve: 'secp224r1', 16 publicKeyEncoding: { 17 format: 'jwk' 18 }, 19 privateKeyEncoding: { 20 format: 'jwk' 21 } 22 }), { 23 name: 'Error', 24 code: 'ERR_CRYPTO_JWK_UNSUPPORTED_CURVE', 25 message: 'Unsupported JWK EC curve: secp224r1.' 26 }); 27} 28