sign
external fun sign(algorithm: String?, data: ArrayBufferView<*>, key: SignKeyObjectInput): Buffer(source)
external fun sign(algorithm: String?, data: ArrayBufferView<*>, key: SignPrivateKeyInput): Buffer(source)
external fun sign(algorithm: String?, data: ArrayBufferView<*>, key: SignJsonWebKeyInput): Buffer(source)
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 (especially Ed25519 and Ed448).
If key
is not a KeyObject
, this function behaves as if key
had been passed to {@link 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.
Since
v12.0.0
external fun sign(algorithm: String?, data: ArrayBufferView<*>, key: KeyLike, callback: (JsError?, data: Buffer) -> Unit)(source)
external fun sign(algorithm: String?, data: ArrayBufferView<*>, key: SignKeyObjectInput, callback: (JsError?, data: Buffer) -> Unit)(source)
external fun sign(algorithm: String?, data: ArrayBufferView<*>, key: SignPrivateKeyInput, callback: (JsError?, data: Buffer) -> Unit)(source)
external fun sign(algorithm: String?, data: ArrayBufferView<*>, key: SignJsonWebKeyInput, callback: (JsError?, data: Buffer) -> Unit)(source)