Skip to content

Commit

Permalink
add some doc
Browse files Browse the repository at this point in the history
  • Loading branch information
codabrink committed Jan 15, 2025
1 parent 0c538c9 commit bbb0be3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions bindings_ffi/src/mls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,11 +379,13 @@ impl FfiXmtpClient {
Ok(result.into())
}

/// A utility function to sign a piece of text with this installation's private key.
pub fn sign_with_installation_key(&self, text: &str) -> Result<Vec<u8>, GenericError> {
let inner = self.inner_client.as_ref();
Ok(inner.context().sign_with_public_context(text)?)
}

/// A utility function to easily verify that a piece of text was signed by this installation.
pub fn verify_signed_with_installation_key(
&self,
signature_text: &str,
Expand All @@ -395,6 +397,8 @@ impl FfiXmtpClient {
self.verify_signed_with_public_key(signature_text, signature_bytes, public_key)
}

/// A utility function to easily verify that a string has been signed by another libXmtp installation.
/// Only works for verifying libXmtp public context signatures.
pub fn verify_signed_with_public_key(
&self,
signature_text: &str,
Expand Down
2 changes: 1 addition & 1 deletion xmtp_mls/src/groups/device_sync/backup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ mod tests {
use crate::{builder::ClientBuilder, groups::GroupMetadataOptions};
use backup_exporter::BackupExporter;
use backup_importer::BackupImporter;
use std::{fs::File, path::Path, sync::Arc};
use std::{path::Path, sync::Arc};
use xmtp_cryptography::utils::generate_local_wallet;

#[tokio::test]
Expand Down

0 comments on commit bbb0be3

Please sign in to comment.