pub(crate) async fn device_keys(&self) -> DeviceKeys {
        let mut device_keys = self.unsigned_device_keys();

        // Create a copy of the device keys containing only fields that will
        // get signed.
        let json_device_keys = json!({
            "user_id": device_keys.user_id,
            "device_id": device_keys.device_id,
            "algorithms": device_keys.algorithms,
            "keys": device_keys.keys,
        });

        device_keys
            .signatures
            .entry(self.user_id().to_owned())
            .or_insert_with(BTreeMap::new)
            .insert(
                DeviceKeyId::from_parts(DeviceKeyAlgorithm::Ed25519, &self.device_id),
                self.sign_json(json_device_keys).await,
            );

        device_keys
    }
/// Sign the device keys of the account and return them so they can be
/// uploaded.
Sign the device keys of the account and return them so they can be
uploaded.
Sign the device keys of the account and return them so they can be uploaded .
pub(crate) async fn device_keys(&self) -> DeviceKeys {
        let mut device_keys = self.unsigned_device_keys();
        // Create a copy of the device keys containing only fields that will
        // get signed.
        let json_device_keys = json!({
            "user_id": device_keys.user_id,
            "device_id": device_keys.device_id,
            "algorithms": device_keys.algorithms,
            "keys": device_keys.keys,
        });
        device_keys
            .signatures
            .entry(self.user_id().to_owned())
            .or_insert_with(BTreeMap::new)
            .insert(
                DeviceKeyId::from_parts(DeviceKeyAlgorithm::Ed25519, &self.device_id),
                self.sign_json(json_device_keys).await,
            );
        device_keys
    }
pub ( crate ) async fn device_keys ( & self ) -> DeviceKeys { let mut device_keys = self . unsigned_device_keys ( ) ; // Create a copy of the device keys containing only fields that will // get signed. let json_device_keys = json ! ( { " " device_keys user_id " " device_keys device_id " " device_keys algorithms " " device_keys keys } ) ; device_keys . signatures . entry ( self . user_id ( ) . to_owned ( ) ) . or_insert_with ( BTreeMap :: new ) . insert ( DeviceKeyId :: from_parts ( DeviceKeyAlgorithm :: Ed25519 , & self . device_id ) , self . sign_json ( json_device_keys ) . await , ) ; device_keys }
Sign the device keys of the account and return them so they can be
uploaded.
Sign the device keys of the account and return them so they can be uploaded .
&self
&self