ic_vetkd_notes/
vetkd_types.rs

1use candid::CandidType;
2use candid::Deserialize;
3use candid::Principal;
4
5pub type CanisterId = Principal;
6
7// Initial LOW LEVEL support for vetkd
8
9#[derive(CandidType, Deserialize)]
10pub enum VetKDCurve {
11    #[serde(rename = "bls12_381")]
12    Bls12_381,
13}
14
15#[derive(CandidType, Deserialize)]
16pub struct VetKDKeyId {
17    pub curve: VetKDCurve,
18    pub name: String,
19}
20
21#[derive(CandidType, Deserialize)]
22pub struct VetKDPublicKeyRequest {
23    pub canister_id: Option<CanisterId>,
24    pub derivation_path: Vec<Vec<u8>>,
25    pub key_id: VetKDKeyId,
26}
27
28#[derive(CandidType, Deserialize)]
29pub struct VetKDPublicKeyReply {
30    pub public_key: Vec<u8>,
31}
32
33#[derive(CandidType, Deserialize)]
34pub struct VetKDEncryptedKeyRequest {
35    pub public_key_derivation_path: Vec<Vec<u8>>,
36    pub derivation_id: Vec<u8>,
37    pub key_id: VetKDKeyId,
38    pub encryption_public_key: Vec<u8>,
39}
40
41#[derive(CandidType, Deserialize)]
42pub struct VetKDEncryptedKeyReply {
43    pub encrypted_key: Vec<u8>,
44}
45
46// END