mirror of
https://gitlab.com/futo-org/fcast.git
synced 2025-08-09 10:42:50 +00:00
Added encryption.
This commit is contained in:
parent
b8bd78d90d
commit
9599c1931e
29 changed files with 1016 additions and 1069 deletions
|
@ -69,42 +69,4 @@ pub struct PlaybackErrorMessage {
|
|||
#[derive(Deserialize, Debug)]
|
||||
pub struct VersionMessage {
|
||||
pub version: u64,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct KeyExchangeMessage {
|
||||
pub version: u64,
|
||||
#[serde(rename = "publicKey")]
|
||||
pub public_key: String,
|
||||
}
|
||||
|
||||
impl KeyExchangeMessage {
|
||||
pub fn new(version: u64, public_key: String) -> Self {
|
||||
Self { version, public_key }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct DecryptedMessage {
|
||||
pub opcode: u64,
|
||||
pub message: Option<String>,
|
||||
}
|
||||
|
||||
impl DecryptedMessage {
|
||||
pub fn new(opcode: u64, message: Option<String>) -> Self {
|
||||
Self { opcode, message }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
pub struct EncryptedMessage {
|
||||
pub version: u64,
|
||||
pub iv: Option<String>,
|
||||
pub blob: String,
|
||||
}
|
||||
|
||||
impl EncryptedMessage {
|
||||
pub fn new(version: u64, iv: Option<String>, blob: String) -> Self {
|
||||
Self { version, iv, blob }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue