[][src]Function sr25519::sign

pub fn sign(keypair: Keypair, message: Message) -> PyResult<Sig>

Signs a message with the given keypair, returning the resulting signature.

Arguments

  • keypair - The sr25519 keypair to sign with, as a tuple of (public_bytes, private_bytes)
  • message - The binary message to sign.

Returns

A 64-byte signature.

Raises

  • ValueError - If either the public or private key is invalid.