diff --git a/crates/ruma-events/src/secret_storage/default_key.rs b/crates/ruma-events/src/secret_storage/default_key.rs index 5d0c08e0..aae7572f 100644 --- a/crates/ruma-events/src/secret_storage/default_key.rs +++ b/crates/ruma-events/src/secret_storage/default_key.rs @@ -15,3 +15,13 @@ pub struct SecretStorageDefaultKeyEventContent { #[serde(rename = "key")] pub key_id: String, } + +impl SecretStorageDefaultKeyEventContent { + /// Create a new [`SecretStorageDefaultKeyEventContent`] with the given key ID. + /// + /// Uploading this to the account data will mark the secret storage key with the given key ID as + /// the default key. + pub fn new(key_id: String) -> Self { + Self { key_id } + } +}