add encrypted private section to group lists and channels

This commit is contained in:
2026-10-10 21:07:25 +07:00
parent ea95756637
commit f8a987003d
7 changed files with 451 additions and 248 deletions
+20
View File
@@ -59,6 +59,26 @@ impl UniversalSigner {
{
*self.inner.write().expect("RwLock poisoned") = Arc::new(InnerSignerImpl(new_signer));
}
/// Encrypt a payload to the given key with NIP-44.
pub async fn nip44_encrypt(
&self,
public_key: &PublicKey,
content: &str,
) -> Result<String, UniversalSignerError> {
let inner = self.inner.read().expect("RwLock poisoned").clone();
inner.nip44_encrypt_async(public_key, content).await
}
/// Decrypt a NIP-44 payload from the given key.
pub async fn nip44_decrypt(
&self,
public_key: &PublicKey,
payload: &str,
) -> Result<String, UniversalSignerError> {
let inner = self.inner.read().expect("RwLock poisoned").clone();
inner.nip44_decrypt_async(public_key, payload).await
}
}
trait InnerSigner: fmt::Debug + Send + Sync + 'static {