Skip to main content

EatClaimsSet

Struct EatClaimsSet 

Source
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

FieldJWT nameCWT key
iat—6
nonceeat_nonce10
ueidueid256
sueidssueids257
oem_idoemid258
hw_modelhwmodel259
hw_versionhwversion260
uptimeuptime261
oem_bootoemboot262
dbg_statdbgstat263
locationlocation264
eat_profileeat_profile265
submodssubmods266
boot_countbootcount267
boot_seedbootseed268
dloasdloas269
sw_nameswname270
sw_versionswversion271
manifestsmanifests272
measurementsmeasurements273
meas_resmeasres274
int_useintuse275

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.

Source

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.

Source

pub fn to_cbor_bytes(&self) -> Result<Vec<u8>, Box<dyn Error>>

Encode the claims-set to raw CBOR bytes.

Source

pub fn from_cbor_value(value: &Value) -> Result<Self, Box<dyn Error>>

Parse from a CBOR Value::Map representation into EatClaimsSet.

Source

pub fn from_cbor_bytes(bytes: &[u8]) -> Result<Self, Box<dyn Error>>

Decode the claims-set from raw CBOR bytes.

Source

pub fn from_bytes(bytes: &[u8]) -> Result<Self, Box<dyn Error>>

Trait Implementations§

Source§

impl Clone for EatClaimsSet

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EatClaimsSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EatClaimsSet

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more