diff --git a/matrix_sdk_crypto/src/file_encryption/attachments.rs b/matrix_sdk_crypto/src/file_encryption/attachments.rs index b578d71c..1ea0469e 100644 --- a/matrix_sdk_crypto/src/file_encryption/attachments.rs +++ b/matrix_sdk_crypto/src/file_encryption/attachments.rs @@ -257,12 +257,18 @@ impl<'a, R: Read + 'a> AttachmentEncryptor<'a, R> { } } +/// Struct holding all the information that is needed to decrypt an encrypted +/// file. #[derive(Debug, Serialize, Deserialize)] pub struct EncryptionInfo { #[serde(rename = "v")] + /// The version of the encryption scheme. pub version: String, + /// The web key that was used to encrypt the file. pub web_key: JsonWebKey, + /// The initialization vector that was used to encrypt the file. pub iv: String, + /// The hashes that can be used to check the validity of the file. pub hashes: BTreeMap, } diff --git a/matrix_sdk_crypto/src/file_encryption/mod.rs b/matrix_sdk_crypto/src/file_encryption/mod.rs index 41e0b045..481659dd 100644 --- a/matrix_sdk_crypto/src/file_encryption/mod.rs +++ b/matrix_sdk_crypto/src/file_encryption/mod.rs @@ -1,5 +1,5 @@ mod attachments; mod key_export; -pub use attachments::{AttachmentDecryptor, AttachmentEncryptor, DecryptorError}; +pub use attachments::{AttachmentDecryptor, AttachmentEncryptor, DecryptorError, EncryptionInfo}; pub use key_export::{decrypt_key_export, encrypt_key_export};