Skip to main content

zlicenser_protocol/message/
binding.rs

1// Field order is the wire format. Do not reorder without a protocol version bump.
2
3use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
6pub struct BindingCertificate {
7    pub payload: BindingPayload,
8    #[serde(with = "crate::wire::bytes::sig_bytes")]
9    pub vendor_signature: [u8; 64],
10}
11
12#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
13pub struct BindingPayload {
14    pub protocol_version: u16,
15    pub binding_id: [u8; 16],
16    pub grant_id: [u8; 16],
17    pub receipt_id: [u8; 16],
18    pub request_id: [u8; 16],
19    /// BLAKE3 hash of the full canonical Receipt bytes (payload + customer signature).
20    pub receipt_hash: [u8; 32],
21    pub vendor_public_key: [u8; 32],
22    pub bound_at: u64,
23    #[serde(skip_serializing_if = "Option::is_none")]
24    pub tsa_token: Option<Vec<u8>>,
25}