Skip to main content

OwnedDeviceSigningKeyId

Type Alias OwnedDeviceSigningKeyId 

Source
pub type OwnedDeviceSigningKeyId = OwnedSigningKeyId<DeviceId>;
Expand description

Algorithm + key name for [device signing] keys.

Aliased Type§

pub struct OwnedDeviceSigningKeyId { /* private fields */ }

Methods from Deref<Target = KeyId<A, K>>§

Source

pub fn as_str(&self) -> &str

Extracts a string slice from this KeyId.

Source

pub fn as_bytes(&self) -> &[u8] ⓘ

Extracts a byte slice from this KeyId.

Source

pub fn algorithm(&self) -> A

Returns key algorithm of the key ID - the part that comes before the colon.

§Example
use ruma_common::{DeviceKeyAlgorithm, DeviceKeyId};

let k = DeviceKeyId::parse("ed25519:1").unwrap();
assert_eq!(k.algorithm(), DeviceKeyAlgorithm::Ed25519);
Source

pub fn key_name<'a>(&'a self) -> &'a K
where &'a K: TryFrom<&'a str>,

Returns the key name of the key ID - the part that comes after the colon.

§Example
use ruma_common::DeviceKeyId;

let k = DeviceKeyId::parse("ed25519:DEV1").unwrap();
assert_eq!(k.key_name(), "DEV1");