Sign Credential
Overview
The sign_message_with_private_key
function to sign a message using a private key and a random number generator in a Rust environment. The function returns either a generated signature and nonce or an error message.
Function Definition
Parameters:
private_key: A reference to the private key used for signing. It's of type
PrivateKey<Testnet3>
.message: An array slice of message elements, each being of type
Field<Testnet3>
.rng: A mutable reference to a random number generator (
TestRng
) for cryptographic operations.
Returns:
A Result
containing either:
A tuple of the generated signature (
Signature<Testnet3>
) and a nonce (Scalar<Testnet3>
), orAn error message (
String
) indicating the failure.
Last updated