33 lines
763 B
Rust
33 lines
763 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],
|
|
) -> Result<EncryptedMessage, crate::error::AppTransportError> {
|
|
Err(crate::error::AppTransportError::Internal)
|
|
}
|
|
|
|
pub fn decrypt(
|
|
&self,
|
|
_encrypted: &EncryptedMessage,
|
|
_private_key: &[u8],
|
|
) -> Result<Vec<u8>, crate::error::AppTransportError> {
|
|
Err(crate::error::AppTransportError::Internal)
|
|
}
|
|
}
|