37 lines
815 B
Rust
37 lines
815 B
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
|
pub struct EncryptedMessage {
|
|
pub ciphertext: Vec<u8>,
|
|
pub nonce: Vec<u8>,
|
|
pub recipient_key_id: String,
|
|
}
|
|
|
|
pub struct E2EEncryption;
|
|
|
|
impl E2EEncryption {
|
|
pub fn new() -> Self {
|
|
Self {}
|
|
}
|
|
|
|
pub fn encrypt(
|
|
&self,
|
|
_plaintext: &[u8],
|
|
_recipient_public_key: &[u8],
|
|
) -> crate::ChannelResult<EncryptedMessage> {
|
|
Err(crate::ChannelError::Internal(
|
|
"e2e not implemented".to_string(),
|
|
))
|
|
}
|
|
|
|
pub fn decrypt(
|
|
&self,
|
|
_encrypted: &EncryptedMessage,
|
|
_private_key: &[u8],
|
|
) -> crate::ChannelResult<Vec<u8>> {
|
|
Err(crate::ChannelError::Internal(
|
|
"e2e not implemented".to_string(),
|
|
))
|
|
}
|
|
}
|