1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// Namespace: "keybase.1"
// Protocol: "ephemeral"
#![allow(dead_code)]
#![allow(non_snake_case)]
#![allow(non_camel_case_types)]
#![allow(unused_imports)]
use serde::{Serialize, Deserialize};
use serde_repr::{Deserialize_repr, Serialize_repr};use super::*;

use super::common::*;
// @lint("ignore")
pub type EkGeneration = i64;

pub struct DeviceEkMetadata {
  pub kid: KID,
  pub hashMeta: HashMeta,
  pub generation: EkGeneration,
  pub ctime: Time,
  pub deviceCtime: Time,
}

pub struct DeviceEkStatement {
  pub currentDeviceEkMetadata: DeviceEkMetadata,
}

pub struct DeviceEk {
  pub seed: Bytes32,
  pub metadata: DeviceEkMetadata,
}

pub struct UserEkStatement {
  pub currentUserEkMetadata: UserEkMetadata,
}

pub struct UserEkMetadata {
  pub kid: KID,
  pub hashMeta: HashMeta,
  pub generation: EkGeneration,
  pub ctime: Time,
}

pub struct UserEkBoxed {
  pub box_: Option<String>,
  pub deviceEkGeneration: EkGeneration,
  pub metadata: UserEkMetadata,
}

pub struct UserEkBoxMetadata {
  pub box_: Option<String>,
  pub recipientGeneration: EkGeneration,
  pub recipientDeviceID: DeviceID,
}

pub struct UserEk {
  pub seed: Bytes32,
  pub metadata: UserEkMetadata,
}

pub struct UserEkReboxArg {
  pub userEkBoxMetadata: UserEkBoxMetadata,
  pub deviceID: DeviceID,
  pub deviceEkStatementSig: Option<String>,
}

pub struct TeamEkMetadata {
  pub kid: KID,
  pub hashMeta: HashMeta,
  pub generation: EkGeneration,
  pub ctime: Time,
}

pub struct TeamEkStatement {
  pub currentTeamEkMetadata: TeamEkMetadata,
}

pub struct TeamEkBoxed {
  pub box_: Option<String>,
  pub userEkGeneration: EkGeneration,
  pub metadata: TeamEkMetadata,
}

pub struct TeamEkBoxMetadata {
  pub box_: Option<String>,
  pub recipientGeneration: EkGeneration,
  pub recipientUID: UID,
}

pub struct TeamEk {
  pub seed: Bytes32,
  pub metadata: TeamEkMetadata,
}

pub struct TeambotEkMetadata {
  pub kid: KID,
  pub generation: EkGeneration,
  pub uid: UID,
  pub userEkGeneration: EkGeneration,
  pub hashMeta: HashMeta,
  pub ctime: Time,
}

pub struct TeambotEkBoxed {
  pub box_: Option<String>,
  pub metadata: TeambotEkMetadata,
}

pub struct TeambotEk {
  pub seed: Bytes32,
  pub metadata: TeambotEkMetadata,
}

#[derive(Serialize_repr, Deserialize_repr, Debug, Hash, PartialEq, Eq)]
#[repr(u8)]
pub enum TeamEphemeralKeyType {
  Team_0,
  Teambot_1,
}

pub enum TeamEphemeralKey {
  Team {team: TeamEk},
  Teambot {teambot: TeambotEk},
}

pub enum TeamEphemeralKeyBoxed {
  Team {team: TeamEkBoxed},
  Teambot {teambot: TeambotEkBoxed},
}