pub struct EatClaimsSet {Show 22 fields
pub iat: Option<i64>,
pub nonce: Option<Value>,
pub ueid: Option<Vec<u8>>,
pub sueids: Option<Value>,
pub oem_id: Option<Value>,
pub hw_model: Option<Vec<u8>>,
pub hw_version: Option<Value>,
pub uptime: Option<u64>,
pub oem_boot: Option<bool>,
pub dbg_stat: Option<u64>,
pub location: Option<Value>,
pub eat_profile: Option<String>,
pub submods: Option<Value>,
pub boot_count: Option<u64>,
pub boot_seed: Option<Vec<u8>>,
pub dloas: Option<Value>,
pub sw_name: Option<String>,
pub sw_version: Option<Value>,
pub manifests: Option<Value>,
pub measurements: Option<Value>,
pub meas_res: Option<Value>,
pub int_use: Option<u64>,
}Expand description
Strongly-typed representation of an RFC 9711 EAT claims-set.
Every field is Option<…> so that only the claims relevant to a
particular token need to be populated. Fields whose CBOR value type
is composite (map / array) are left as raw ciborium::value::Value so
that callers can construct them without an additional indirection layer.
§Claim → CBOR key mapping
| Field | JWT name | CWT key |
|---|---|---|
iat | — | 6 |
nonce | eat_nonce | 10 |
ueid | ueid | 256 |
sueids | sueids | 257 |
oem_id | oemid | 258 |
hw_model | hwmodel | 259 |
hw_version | hwversion | 260 |
uptime | uptime | 261 |
oem_boot | oemboot | 262 |
dbg_stat | dbgstat | 263 |
location | location | 264 |
eat_profile | eat_profile | 265 |
submods | submods | 266 |
boot_count | bootcount | 267 |
boot_seed | bootseed | 268 |
dloas | dloas | 269 |
sw_name | swname | 270 |
sw_version | swversion | 271 |
manifests | manifests | 272 |
measurements | measurements | 273 |
meas_res | measres | 274 |
int_use | intuse | 275 |
Fields§
§iat: Option<i64>Issued-At: seconds since POSIX epoch (CWT key 6).
nonce: Option<Value>Nonce – eat_nonce (key 10).
CBOR value: bstr or array-of-bstr.
ueid: Option<Vec<u8>>Universal Entity ID – ueid (key 256).
A byte string whose first byte encodes the UEID type
(0x01 = RAND, 0x02 = IEEE EUI, 0x03 = IMEI, …).
sueids: Option<Value>Semipermanent UEIDs – sueids (key 257).
CBOR value: map of label → bstr.
oem_id: Option<Value>Hardware OEM ID – oemid (key 258).
CBOR value: bstr or int.
hw_model: Option<Vec<u8>>Hardware Model – hwmodel (key 259).
A byte string that uniquely identifies the model within an OEM.
hw_version: Option<Value>Hardware Version – hwversion (key 260).
CBOR value: array [version-string, scheme].
uptime: Option<u64>Uptime in seconds – uptime (key 261).
oem_boot: Option<bool>OEM Authorized Boot indicator – oemboot (key 262).
true when the booted software is OEM-authorized.
dbg_stat: Option<u64>Debug Status – dbgstat (key 263).
Encoded as a uint; see RFC 9711 Section 4.2.8 for the registry.
location: Option<Value>Geographic Location – location (key 264).
CBOR value: map with optional latitude, longitude, altitude, …
eat_profile: Option<String>EAT Profile – eat_profile (key 265).
A URI or OID identifying the profile this token conforms to.
submods: Option<Value>Submodules Section – submods (key 266).
CBOR value: map of submodule-name → nested-token or claims-set.
boot_count: Option<u64>Boot Count – bootcount (key 267).
boot_seed: Option<Vec<u8>>Boot Seed – bootseed (key 268).
A byte string that changes on every boot; ties measurements to a
single boot cycle.
dloas: Option<Value>DLOAs – dloas (key 269).
CBOR value: array of DLOA maps (Digital Letters of Approval).
sw_name: Option<String>Software Name – swname (key 270).
sw_version: Option<Value>Software Version – swversion (key 271).
CBOR value: array [version-string, scheme].
manifests: Option<Value>Software Manifests – manifests (key 272).
CBOR value: array of CoSWID or similar manifest structures.
measurements: Option<Value>Measurements – measurements (key 273).
CBOR value: array of measurement maps.
meas_res: Option<Value>Software Measurement Results – measres (key 274).
CBOR value: array of measurement-result maps.
int_use: Option<u64>Intended Use – intuse (key 275).
Encoded as a uint; see RFC 9711 Section 4.2.20 for the registry.
Implementations§
Source§impl EatClaimsSet
CBOR encoding and decoding of the claims-set.
impl EatClaimsSet
CBOR encoding and decoding of the claims-set.
Sourcepub fn to_cbor_value(&self) -> Value
pub fn to_cbor_value(&self) -> Value
Serialise the populated fields into a CBOR map (Value::Map).
Only Some(…) fields are emitted; absent claims are omitted from
the encoding, consistent with RFC 9711’s optional-claim model.
Sourcepub fn to_cbor_bytes(&self) -> Result<Vec<u8>, Box<dyn Error>>
pub fn to_cbor_bytes(&self) -> Result<Vec<u8>, Box<dyn Error>>
Encode the claims-set to raw CBOR bytes.
Sourcepub fn from_cbor_value(value: &Value) -> Result<Self, Box<dyn Error>>
pub fn from_cbor_value(value: &Value) -> Result<Self, Box<dyn Error>>
Parse from a CBOR Value::Map representation into EatClaimsSet.
Sourcepub fn from_cbor_bytes(bytes: &[u8]) -> Result<Self, Box<dyn Error>>
pub fn from_cbor_bytes(bytes: &[u8]) -> Result<Self, Box<dyn Error>>
Decode the claims-set from raw CBOR bytes.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, Box<dyn Error>>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, Box<dyn Error>>
Alias for Self::from_cbor_bytes.