diff --git a/src/node/crypto.ts b/src/node/crypto.ts index 9c3231f34d1..d0a75d51065 100644 --- a/src/node/crypto.ts +++ b/src/node/crypto.ts @@ -285,14 +285,14 @@ export default { // * [x] crypto.createHash(algorithm[, options]) // * [x] crypto.createHmac(algorithm, key[, options]) // * [x] crypto.getHashes() -// * Keys -// * [ ] crypto.createPrivateKey(key) -// * [ ] crypto.createPublicKey(key) -// * [x] crypto.createSecretKey(key[, encoding]) -// * [x] crypto.generateKey(type, options, callback) -// * [x] crypto.generateKeyPair(type, options, callback) -// * [x] crypto.generateKeyPairSync(type, options) -// * [x] crypto.generateKeySync(type, options) +// * Keys, not implemented yet. Calling the following APIs will throw a ERR_METHOD_NOT_IMPLEMENTED +// * [.] crypto.createPrivateKey(key) +// * [.] crypto.createPublicKey(key) +// * [.] crypto.createSecretKey(key[, encoding]) +// * [.] crypto.generateKey(type, options, callback) +// * [.] crypto.generateKeyPair(type, options, callback) +// * [.] crypto.generateKeyPairSync(type, options) +// * [.] crypto.generateKeySync(type, options) // * Sign/Verify // * [ ] crypto.createSign(algorithm[, options]) // * [ ] crypto.createVerify(algorithm[, options]) diff --git a/src/node/internal/crypto_keys.ts b/src/node/internal/crypto_keys.ts index 83fc9fc91ad..014d0d7a729 100644 --- a/src/node/internal/crypto_keys.ts +++ b/src/node/internal/crypto_keys.ts @@ -438,10 +438,7 @@ export function generateKey( _options: GenerateKeyOptions, callback: GenerateKeyCallback ) { - // We intentionally have not implemented key generation up to this point. - // The reason is that generation of cryptographically safe keys is a CPU - // intensive operation that can often exceed limits on the amount of CPU - // time a worker is allowed. + // This API is not implemented yet. callback(new ERR_METHOD_NOT_IMPLEMENTED('crypto.generateKeySync')); } @@ -449,10 +446,7 @@ export function generateKeySync( _type: SecretKeyType, _options: GenerateKeyOptions ) { - // We intentionally have not implemented key generation up to this point. - // The reason is that generation of cryptographically safe keys is a CPU - // intensive operation that can often exceed limits on the amount of CPU - // time a worker is allowed. + // This API is not implemented yet. throw new ERR_METHOD_NOT_IMPLEMENTED('crypto.generateKeySync'); } @@ -461,10 +455,7 @@ export function generateKeyPair( _options: GenerateKeyPairOptions, callback: GenerateKeyPairCallback ) { - // We intentionally have not implemented key generation up to this point. - // The reason is that generation of cryptographically safe keys is a CPU - // intensive operation that can often exceed limits on the amount of CPU - // time a worker is allowed. + // This API is not implemented yet. callback(new ERR_METHOD_NOT_IMPLEMENTED('crypto.generateKeyPair')); } @@ -472,9 +463,6 @@ export function generateKeyPairSync( _type: AsymmetricKeyType, _options: GenerateKeyPairOptions ): KeyObjectPair { - // We intentionally have not implemented key generation up to this point. - // The reason is that generation of cryptographically safe keys is a CPU - // intensive operation that can often exceed limits on the amount of CPU - // time a worker is allowed. + // This API is not implemented yet. throw new ERR_METHOD_NOT_IMPLEMENTED('crypto.generateKeyPairSync'); }