Struct olm_rs::pk::OlmPkSigning [−][src]
pub struct OlmPkSigning { /* fields omitted */ }Expand description
Signs messages using public key cryptography.
Implementations
Create a new signing object.
Arguments
seed- the seed to use as the private key for signing. The seed must have the same length as the seeds generated byOlmPkSigning::generate_seed(). The correct length can be checked usingOlmPkSigning::seed_length()as well.
Get the required seed length.
Generate a random seed that can be used to initialize a OlmPkSigning
object.
Get the public key of the the OlmPkSigning object.
This can be used to check the signature of a messsage that has been signed by this object.
Example
let message = "It's a secret to everyone".to_string(); let sign = OlmPkSigning::new(&OlmPkSigning::generate_seed()).unwrap(); let utility = OlmUtility::new(); let signature = sign.sign(&message); utility.ed25519_verify(sign.public_key(), &message, signature).unwrap();