mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 23:48:12 +00:00
feat(rust/trezor-client): add get_ecdh_session_key
method
This commit is contained in:
parent
4374485805
commit
6d371be724
@ -238,4 +238,17 @@ impl Trezor {
|
|||||||
req.set_ecdsa_curve_name(curve);
|
req.set_ecdsa_curve_name(curve);
|
||||||
self.call(req, Box::new(|_, m| Ok(m.signature().to_owned())))
|
self.call(req, Box::new(|_, m| Ok(m.signature().to_owned())))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_ecdh_session_key(
|
||||||
|
&mut self,
|
||||||
|
identity: protos::IdentityType,
|
||||||
|
peer_public_key: Vec<u8>,
|
||||||
|
curve: String,
|
||||||
|
) -> Result<TrezorResponse<'_, protos::ECDHSessionKey, protos::ECDHSessionKey>> {
|
||||||
|
let mut req = protos::GetECDHSessionKey::new();
|
||||||
|
req.identity = MessageField::some(identity);
|
||||||
|
req.set_peer_public_key(peer_public_key);
|
||||||
|
req.set_ecdsa_curve_name(curve);
|
||||||
|
self.call(req, Box::new(|_, m| Ok(m)))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user