pub struct PocPayload {
pub predecessor: Vec<u8>,
pub successor: Successor,
pub attestations: Vec<ExecutorAttestation>,
}Expand description
PoC Payload - the CBOR content signed by the executor with COSE_Sign1.
COSE_Sign1 structure:
protected: { alg, kid, challenge } <- challenge in header for freshness
payload: { predecessor, successor, attestations }
signature: ...The kid in the protected header identifies which key was used to sign
this PoC. The key can be resolved from one of the attestations.
Fields§
§predecessor: Vec<u8>Predecessor PCA as raw COSE_Sign1 bytes. Stored as bytes to preserve original signature for verification.
successor: SuccessorProposed authority for next hop
attestations: Vec<ExecutorAttestation>Executor attestations (replaces PoI). Multiple attestations can be provided (identity, environment, capabilities).
Implementations§
Source§impl PocPayload
impl PocPayload
Sourcepub fn from_cbor(bytes: &[u8]) -> Result<PocPayload, Error<Error>>
pub fn from_cbor(bytes: &[u8]) -> Result<PocPayload, Error<Error>>
Deserializes from CBOR bytes.
Sourcepub fn to_json_pretty(&self) -> Result<String, Error>
pub fn to_json_pretty(&self) -> Result<String, Error>
Serializes to pretty-printed JSON string.
Sourcepub fn find_attestation(
&self,
attestation_type: &str,
) -> Option<&ExecutorAttestation>
pub fn find_attestation( &self, attestation_type: &str, ) -> Option<&ExecutorAttestation>
Finds an attestation by type.
Trait Implementations§
Source§impl Clone for PocPayload
impl Clone for PocPayload
Source§fn clone(&self) -> PocPayload
fn clone(&self) -> PocPayload
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PocPayload
impl Debug for PocPayload
Source§impl<'de> Deserialize<'de> for PocPayload
impl<'de> Deserialize<'de> for PocPayload
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PocPayload, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PocPayload, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PocPayload
impl PartialEq for PocPayload
Source§impl Serialize for PocPayload
impl Serialize for PocPayload
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for PocPayload
Auto Trait Implementations§
impl Freeze for PocPayload
impl RefUnwindSafe for PocPayload
impl Send for PocPayload
impl Sync for PocPayload
impl Unpin for PocPayload
impl UnwindSafe for PocPayload
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more