From 01e080d0b556edf30d8d4b4307bdf4310f96110b Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Thu, 14 Apr 2022 18:04:24 +0200 Subject: [PATCH] identifiers: Add owned key id type aliases --- crates/ruma-common/src/identifiers.rs | 5 ++++- crates/ruma-common/src/identifiers/key_id.rs | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/ruma-common/src/identifiers.rs b/crates/ruma-common/src/identifiers.rs index dcbe88bf..a1b8a22f 100644 --- a/crates/ruma-common/src/identifiers.rs +++ b/crates/ruma-common/src/identifiers.rs @@ -15,7 +15,10 @@ pub use self::{ device_id::{DeviceId, OwnedDeviceId}, device_key_id::{DeviceKeyId, OwnedDeviceKeyId}, event_id::{EventId, OwnedEventId}, - key_id::{DeviceSigningKeyId, KeyId, ServerSigningKeyId, SigningKeyId}, + key_id::{ + DeviceSigningKeyId, KeyId, OwnedDeviceSigningKeyId, OwnedKeyId, OwnedServerSigningKeyId, + OwnedSigningKeyId, ServerSigningKeyId, SigningKeyId, + }, key_name::{KeyName, OwnedKeyName}, matrix_uri::{MatrixToUri, MatrixUri}, mxc_uri::{MxcUri, OwnedMxcUri}, diff --git a/crates/ruma-common/src/identifiers/key_id.rs b/crates/ruma-common/src/identifiers/key_id.rs index e2aba220..359ea735 100644 --- a/crates/ruma-common/src/identifiers/key_id.rs +++ b/crates/ruma-common/src/identifiers/key_id.rs @@ -57,12 +57,21 @@ impl KeyId { /// Algorithm + key name for signing keys. pub type SigningKeyId = KeyId; +/// Algorithm + key name for signing keys. +pub type OwnedSigningKeyId = OwnedKeyId; + /// Algorithm + key name for homeserver signing keys. pub type ServerSigningKeyId = SigningKeyId; +/// Algorithm + key name for homeserver signing keys. +pub type OwnedServerSigningKeyId = OwnedSigningKeyId; + /// Algorithm + key name for device keys. pub type DeviceSigningKeyId = SigningKeyId; +/// Algorithm + key name for device keys. +pub type OwnedDeviceSigningKeyId = OwnedSigningKeyId; + // The following impls are usually derived using the std macros. // They are implemented manually here to avoid unnecessary bounds. impl PartialEq for KeyId {