Struct olm_rs::utility::OlmUtility [−][src]
pub struct OlmUtility { /* fields omitted */ }Implementations
Allows you to make use of crytographic hashing via SHA-2 and verifying ed25519 signatures.
Returns a sha256 of the supplied byte slice.
C-API equivalent
olm_sha256
Panics
OUTPUT_BUFFER_TOO_SMALLfor supplied output buffer- on malformed UTF-8 coding of the hash provided by libolm
Convenience function that converts the UTF-8 message
to bytes and then calls sha256_bytes(), returning its output.
pub fn ed25519_verify(
&self,
key: &str,
message: &str,
signature: String
) -> Result<bool, OlmUtilityError>
pub fn ed25519_verify(
&self,
key: &str,
message: &str,
signature: String
) -> Result<bool, OlmUtilityError>
Verify a ed25519 signature.
Arugments
key- The public part of the ed25519 key that signed the message.message- The message that was signed.signature- The signature of the message.
C-API equivalent
olm_ed25519_verify