温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/node/crypto/sign
点击访问原文链接

Node crypto.sign function | API Reference | Bun

Node crypto.sign function | API Reference | BunBuildDocsReferenceGuidesBlogDiscord/node:crypto/signFsign

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:crypto/signFsign

function

crypto.signfunction sign(algorithm: undefined | null | string,data: ArrayBufferView,key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput): NonSharedBuffer;

Calculates and returns the signature for data using the given private key and algorithm. If algorithm is null or undefined, then the algorithm is dependent upon the key type.

algorithm is required to be null or undefined for Ed25519, Ed448, and ML-DSA.

If key is not a KeyObject, this function behaves as if key had been passed to createPrivateKey. If it is an object, the following additional properties can be passed:

If the callback function is provided this function uses libuv's threadpool.

function sign(algorithm: undefined | null | string,data: ArrayBufferView,key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput | SignJsonWebKeyInput,callback: (error: null | Error, data: NonSharedBuffer) => void): void;

Calculates and returns the signature for data using the given private key and algorithm. If algorithm is null or undefined, then the algorithm is dependent upon the key type.

algorithm is required to be null or undefined for Ed25519, Ed448, and ML-DSA.

If key is not a KeyObject, this function behaves as if key had been passed to createPrivateKey. If it is an object, the following additional properties can be passed:

If the callback function is provided this function uses libuv's threadpool.

Referenced typestype KeyLike = string | Buffer | KeyObjectinterface SignKeyObjectInputcontext?: ArrayBuffer | ArrayBufferViewArrayBufferLike>dsaEncoding?: DSAEncodingkey: KeyObjectpadding?: number
saltLength?: numberinterface SignPrivateKeyInputcontext?: ArrayBuffer | ArrayBufferViewArrayBufferLike>dsaEncoding?: DSAEncodingencoding?: stringformat?: KeyFormatkey: string | BufferArrayBufferLike>padding?: number
passphrase?: string | BufferArrayBufferLike>saltLength?: numbertype?: PrivateKeyExportTypeinterface SignJsonWebKeyInputcontext?: ArrayBuffer | ArrayBufferViewArrayBufferLike>dsaEncoding?: DSAEncodingformat: 'jwk'key: JsonWebKeypadding?: number
saltLength?: number

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

Node crypto.sign function | API Reference | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for function node:crypto.sign | Bun