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

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();

Sign a message using this object.

Arguments

  • message - The message that should be signed with the private key of this object.

Panics

  • OUTPUT_BUFFER_TOO_SMALL for the signature buffer that is provided to libolm.
  • on malformed UTF-8 coding of the signature provided by libolm.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.