test: ec2 generateKeyPairSync invalid parameter encoding
PR-URL: https://github.com/nodejs/node/pull/27212 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
1e7823dd4e
commit
de463f1490
@ -449,6 +449,29 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Test invalid parameter encoding.
|
||||||
|
{
|
||||||
|
common.expectsError(() => generateKeyPairSync('ec', {
|
||||||
|
namedCurve: 'P-256',
|
||||||
|
paramEncoding: 'otherEncoding',
|
||||||
|
publicKeyEncoding: {
|
||||||
|
type: 'spki',
|
||||||
|
format: 'pem'
|
||||||
|
},
|
||||||
|
privateKeyEncoding: {
|
||||||
|
type: 'pkcs8',
|
||||||
|
format: 'pem',
|
||||||
|
cipher: 'aes-128-cbc',
|
||||||
|
passphrase: 'top secret'
|
||||||
|
}
|
||||||
|
}), {
|
||||||
|
type: TypeError,
|
||||||
|
code: 'ERR_INVALID_OPT_VALUE',
|
||||||
|
message: 'The value "otherEncoding" is invalid for ' +
|
||||||
|
'option "paramEncoding"'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
// Test the util.promisified API with async RSA key generation.
|
// Test the util.promisified API with async RSA key generation.
|
||||||
promisify(generateKeyPair)('rsa', {
|
promisify(generateKeyPair)('rsa', {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user