🤖 Merge PR #65743 Correct Node@14 Signer type to be Sign by @cjbarth

This commit is contained in:
Chris Barth
2023-06-10 15:21:38 -04:00
committed by GitHub
parent 60ab8a805a
commit ed5580319c
2 changed files with 7 additions and 7 deletions

View File

@@ -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,

View File

@@ -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);