Sign.sign method | Node.js crypto module | Bun
BuildDocsReferenceGuidesBlogDiscord/
node:crypto/
Sign/
signMsign
Search the reference...
/
BuildDocsReferenceGuidesBlogDiscord/
node:crypto/
Sign/
signMsign
method
crypto.Sign.signsign(privateKey:
KeyLike |
SignKeyObjectInput |
SignPrivateKeyInput |
SignJsonWebKeyInput): NonSharedBuffer;
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. 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.
sign(privateKey:
KeyLike |
SignKeyObjectInput |
SignPrivateKeyInput |
SignJsonWebKeyInput,outputFormat:
BinaryToTextEncoding): string;
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. 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.
Referenced typestype
KeyLike = string |
Buffer |
KeyObjectinterface
SignKeyObjectInputcontext?:
ArrayBuffer | ArrayBufferViewArrayBufferLike>
dsaEncoding?:
DSAEncodingkey:
KeyObjectpadding?: number
saltLength?: numberinterface
SignPrivateKeyInputcontext?:
ArrayBuffer | ArrayBufferViewArrayBufferLike>
dsaEncoding?:
DSAEncodingencoding?: string
format?:
KeyFormatkey: string |
BufferArrayBufferLike>
padding?: number
passphrase?: string |
BufferArrayBufferLike>
saltLength?: number
type?:
PrivateKeyExportTypeinterface
SignJsonWebKeyInputcontext?:
ArrayBuffer | ArrayBufferViewArrayBufferLike>
dsaEncoding?:
DSAEncodingformat: 'jwk'
key:
JsonWebKeypadding?: number
saltLength?: numbertype
BinaryToTextEncoding = 'base64' | 'base64url' | 'hex' | 'binary'
Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlog Toolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →