Skip to main content
Sign.prototype.sign - node__crypto.d.ts - Node documentation
method Sign.prototype.sign

Usage in Deno

```typescript import { Sign } from "node:node__crypto.d.ts"; ```
Sign.prototype.sign(privateKey: ): Buffer
Calculates the signature on all the data passed through using either `sign.update()` or `sign.write()`. If `privateKey` is not a `KeyObject`, this function behaves as if `privateKey` had been passed to [createPrivateKey](../.././node__crypto.d.ts/~/createPrivateKey). If it is an object, the following additional properties can be passed: If `outputEncoding` is provided a string is returned; otherwise a `Buffer` is returned. The `Sign` object can not be again used after `sign.sign()` method has been called. Multiple calls to `sign.sign()` will result in an error being thrown.

Parameters

Return Type

Buffer
Sign.prototype.sign(): string

Parameters

Return Type

string