Skip to main content

index/functions/withPrivateKey.md

withPrivateKey<T>(privateKey, action): T

Runs action with a private normalized copy of the key, zeroed afterwards (also when action throws). Bytes given by the caller are copied, never modified: the caller owns them.

Type Parameters​

Type Parameter
T

Parameters​

ParameterType
privateKeyPrivateKeyInput
action(key) => T

Returns​

T