diff --git a/types/node/v14/crypto.d.ts b/types/node/v14/crypto.d.ts index 1f7172a417..1b37934eda 100644 --- a/types/node/v14/crypto.d.ts +++ b/types/node/v14/crypto.d.ts @@ -334,7 +334,7 @@ declare module 'crypto' { function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject): KeyObject; function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject; - function createSign(algorithm: string, options?: stream.WritableOptions): Signer; + function createSign(algorithm: string, options?: stream.WritableOptions): Sign; type DSAEncoding = 'der' | 'ieee-p1363'; @@ -358,11 +358,11 @@ declare module 'crypto' { type KeyLike = string | Buffer | KeyObject; - class Signer extends stream.Writable { + class Sign extends stream.Writable { private constructor(); - update(data: BinaryLike): Signer; - update(data: string, input_encoding: Encoding): Signer; + update(data: BinaryLike): Sign; + update(data: string, input_encoding: Encoding): Sign; sign(private_key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer; sign( private_key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput, diff --git a/types/node/v14/test/crypto.ts b/types/node/v14/test/crypto.ts index 2c68acdc65..e7aa2b2565 100644 --- a/types/node/v14/test/crypto.ts +++ b/types/node/v14/test/crypto.ts @@ -731,7 +731,7 @@ import { promisify } from 'node:util'; namedCurve: 'sect239k1', }); - const sign: crypto.Signer = crypto.createSign('SHA256'); + const sign: crypto.Sign = crypto.createSign('SHA256'); sign.write('some data to sign'); sign.end(); const signature: string = sign.sign(privateKey, 'hex'); @@ -743,7 +743,7 @@ import { promisify } from 'node:util'; // ensure that instanceof works verify instanceof crypto.Verify; - sign instanceof crypto.Signer; + sign instanceof crypto.Sign; } { @@ -751,7 +751,7 @@ import { promisify } from 'node:util'; modulusLength: 2048, }); - const sign: crypto.Signer = crypto.createSign('SHA256'); + const sign: crypto.Sign = crypto.createSign('SHA256'); sign.update('some data to sign'); sign.end(); const signature: Buffer = sign.sign(privateKey);