Skip to main content

vta_sdk/protocols/key_management/
get.rs

1use serde::{Deserialize, Serialize};
2
3use crate::keys::KeyRecord;
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
6#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
7pub struct GetKeyBody {
8    #[serde(rename = "keyId", alias = "key_id")]
9    pub key_id: String,
10}
11
12pub type GetKeyResultBody = KeyRecord;
13
14/// `keys/show/0.1` response — the record under `key`, or `null` where the
15/// maintainer holds none for that identifier.
16///
17/// "No such key" is a successful answer, not an error: a caller that cannot
18/// distinguish absence from failure retries a lookup that will never succeed.
19#[derive(Debug, Clone, Serialize, Deserialize)]
20#[cfg_attr(feature = "openapi", derive(utoipa::ToSchema))]
21pub struct GetKeyResponseBody {
22    pub key: Option<KeyRecord>,
23}