Skip to main content

Signed

Struct Signed 

Source
pub struct Signed<T> { /* private fields */ }
Expand description

One signed artifact: the protocol version it was written under, the body, and the signature over both.

The version lives here rather than inside each body because it says the same thing about every artifact. It is inside the signed bytes, so it cannot be edited without invalidating the signature.

Implementations§

Source§

impl Signed<CircleAccessLeafBody>

Source

pub fn verify_signature(&self) -> bool

Source§

impl Signed<CircleControlBody>

Source

pub fn control_hash(&self) -> ObjectHash

Source

pub fn causally_covers(&self, prior: &Self) -> bool

Source

pub fn verify(&self) -> bool

Source

pub fn coord(&self) -> CircleControlCoord

Source§

impl Signed<CircleControlHeadBody>

Source

pub fn signed( control: &CircleControl, entry: ExactObjectRef, successor: SuccessorLink, signer: &UserKeypair, ) -> Self

Source

pub fn head_hash(&self) -> ObjectHash

Source

pub fn verify(&self, registration: &StoreDeviceRegistration) -> bool

Source§

impl Signed<AccessEnvelopeBody>

Source

pub fn verify( &self, control: &PreparedCircleControl, candidate_family: CandidateFamilyId, ) -> bool

Source§

impl Signed<CircleEpochCloseIntentBody>

Source

pub fn signed( store_root_hash: ObjectHash, circle_id: CircleId, close_id: CircleEpochCloseId, epoch_id: CircleEpochId, predecessor_roster: MergeCircleRosterStateRef, removal: CircleRosterEntry, remaining_roster_state_hash: ObjectHash, signer: &dyn IdentityKeyAuthority, ) -> Result<Self, CircleTransitionError>

Source

pub fn verify(&self) -> bool

Source

pub fn intent_hash(&self) -> ObjectHash

Source§

impl Signed<CircleEpochCloseResponseBody>

Source§

impl Signed<CircleEpochCloseExclusionBody>

Source§

impl Signed<CircleEpochCloseOutcomeBody>

Source§

impl Signed<CircleEpochCloseCancellationBody>

Source§

impl Signed<CircleMetadataBody>

Source

pub fn metadata_hash(&self) -> ObjectHash

Source

pub fn coord(&self) -> CircleMetadataCoord

Source

pub fn verify(&self) -> bool

Source§

impl Signed<CircleMetadataHeadBody>

Source

pub fn signed( metadata: &CircleMetadata, tip: ExactObjectRef, successor: SuccessorLink, signer: &UserKeypair, ) -> Self

Source

pub fn head_hash(&self) -> ObjectHash

Source

pub fn coord(&self) -> CircleMetadataCoord

Source

pub fn verify_for_registration( &self, registration: &StoreDeviceRegistration, ) -> bool

Source§

impl Signed<CircleRosterConflictResolutionBody>

Source§

impl Signed<CircleRosterEntryBody>

Source

pub fn founder( store_root_hash: ObjectHash, circle_id: CircleId, device_id: &str, stream_id: AuthorStreamId, owner_grant: MembershipGrantId, signer: &dyn IdentityKeyAuthority, ) -> Self

Source

pub fn coord(&self) -> CircleRosterCoord

Source

pub fn verify(&self) -> bool

Source§

impl Signed<CircleRosterHeadBody>

Source

pub fn signed( entry: &CircleRosterEntry, tip: ExactObjectRef, successor: SuccessorLink, signer: &UserKeypair, ) -> Self

Source

pub fn head_hash(&self) -> ObjectHash

Source

pub fn verify_for_registration( &self, registration: &StoreDeviceRegistration, ) -> bool

Source

pub fn entry_coord(&self) -> CircleRosterCoord

Source§

impl Signed<StoreMembershipConflictResolutionBody>

Source§

impl Signed<MembershipEntryBody>

Source

pub fn coord(&self) -> MembershipCoord

Source§

impl Signed<AuthorHeadBody>

Source

pub fn signed( store_id: String, body: MembershipHeadBody, activation: MembershipHeadActivation, device_signer: &UserKeypair, ) -> Self

Source

pub fn verify(&self, registration: &StoreDeviceRegistration) -> bool

Source

pub fn entry_coord(&self) -> MembershipCoord

Source

pub fn head_hash(&self) -> ObjectHash

Source§

impl Signed<StoreMemberProviderAccessGrantBody>

Source

pub fn signed( grant_id: ProviderAccessGrantId, member_pubkey: String, provider: ProviderDeviceBinding, locator: ProviderAccessLocator, administrator_grant: ProviderAdminGrantId, administrator: StoreDeviceRegistrationRef, store: &StoreProviderBinding, administrator_registration: &StoreDeviceRegistration, administrator_signer: &dyn DeviceSigningAuthority, ) -> Result<Self, ProviderProbeError>

Source

pub fn grant_hash(&self) -> ObjectHash

Source

pub fn verify( &self, store: &StoreProviderBinding, administrator: &StoreDeviceRegistration, ) -> Result<(), ProviderProbeError>

Source§

impl Signed<ReclaimEvidenceBody>

Source

pub fn signed( store_root_hash: ObjectHash, claim: ReclaimClaim, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn evidence_hash(&self) -> ObjectHash

Source

pub fn verify(&self) -> Result<(), StoreProtocolError>

Source§

impl Signed<ReclaimAuthorizationBody>

Source

pub fn signed( store_root_hash: ObjectHash, target: ReclaimTarget, evidence: ReclaimEvidenceRef, authority: StoreReclaimAuthority, signer: &UserKeypair, ) -> Self

Source

pub fn authorization_hash(&self) -> ObjectHash

Source

pub fn verify(&self, owner_pubkey: &str) -> Result<(), StoreProtocolError>

Source§

impl Signed<ReclaimReceiptBody>

Source

pub fn signed( store_root_hash: ObjectHash, authorization: ReclaimAuthorizationRef, provider_admin_state: StoreMembershipStateRef, provider_admin_grant: ProviderAdminGrantId, executor: StoreDeviceRegistrationRef, executor_registration: &StoreDeviceRegistration, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn receipt_hash(&self) -> ObjectHash

Source

pub fn verify( &self, executor: &StoreDeviceRegistration, ) -> Result<(), StoreProtocolError>

Source§

impl Signed<StoreAckBody>

Source

pub fn signed( store_root_hash: ObjectHash, sequence: u64, assertion: StoreAckAssertion, last_sync: String, successor: SuccessorLink, device_signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn ack_hash(&self) -> ObjectHash

Source

pub fn semantic_hash_from_bytes( bytes: &[u8], ) -> Result<ObjectHash, StoreProtocolError>

Source

pub fn parse_at( bytes: &[u8], expected_store_root: &StoreRootRef, expected: &StoreAckRef, author: &StoreDeviceRegistration, ) -> Result<Self, StoreProtocolError>

Source§

impl Signed<SnapshotMetaBody>

Source

pub fn signed( store_root_hash: ObjectHash, author_registration: StoreDeviceRegistrationRef, generation: u64, predecessor: Option<StoreSnapshotRef>, image: SnapshotImageRef, membership_rollup: MembershipRollupRef, coverage: CommitFrontier, state: StoreSnapshotState, history_summary: RetainedVerifiedMergeHistorySummary, schema_version: u32, created_at: String, successor: SnapshotSuccessorLink, device_signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn snapshot_hash(&self) -> ObjectHash

Source

pub fn semantic_hash_from_bytes( bytes: &[u8], ) -> Result<ObjectHash, StoreProtocolError>

Source

pub fn parse_at( bytes: &[u8], expected_store_root_hash: ObjectHash, expected: &StoreSnapshotRef, author: &StoreDeviceRegistration, ) -> Result<Self, StoreProtocolError>

Source

pub fn parse_stream_entry_at( bytes: &[u8], expected_store_root: &StoreRootRef, expected_registration: &StoreDeviceRegistrationRef, author: &StoreDeviceRegistration, expected: &StoreSnapshotRef, ) -> Result<Self, StoreProtocolError>

Source§

impl Signed<StoreBatchCommitBody>

Source

pub fn signed_reclaim_authorization( store_root_hash: ObjectHash, write_id: WriteId, coord: StoreCommitCoord, author_registration: StoreDeviceRegistrationRef, author: &StoreDeviceRegistration, order: StoreCommitOrder, publication_base: StorePublicationBase, membership_state: StoreMembershipStateRef, device_state: StoreDeviceStateRef, authorization: ReclaimAuthorizationRef, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn signed_reclaim_receipt( store_root_hash: ObjectHash, write_id: WriteId, coord: StoreCommitCoord, author_registration: StoreDeviceRegistrationRef, author: &StoreDeviceRegistration, order: StoreCommitOrder, publication_base: StorePublicationBase, membership_state: StoreMembershipStateRef, device_state: StoreDeviceStateRef, receipt: ReclaimReceiptRef, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn merge_dependencies( &self, ) -> &BTreeMap<AuthorStreamId, StoreBatchCommitRef>

Source

pub fn signed_with_owner_promotion_request( store_root_hash: ObjectHash, write_id: WriteId, coord: StoreCommitCoord, author_registration: StoreDeviceRegistrationRef, author: &StoreDeviceRegistration, order: StoreCommitOrder, publication_base: StorePublicationBase, membership_state: StoreMembershipStateRef, device_state: StoreDeviceStateRef, membership_authority: StoreOperationMembershipAuthority, request: OwnerPromotionRequest, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn signed_with_candidate_abandonment( store_root_hash: ObjectHash, write_id: WriteId, coord: StoreCommitCoord, author_registration: StoreDeviceRegistrationRef, author: &StoreDeviceRegistration, order: StoreCommitOrder, publication_base: StorePublicationBase, membership_state: StoreMembershipStateRef, device_state: StoreDeviceStateRef, manifests: Vec<CandidateCleanupManifest>, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn signed_operations( store_root_hash: ObjectHash, write_id: WriteId, coord: StoreCommitCoord, author_registration: StoreDeviceRegistrationRef, author: &StoreDeviceRegistration, order: StoreCommitOrder, publication_base: StorePublicationBase, membership_state: StoreMembershipStateRef, device_state: StoreDeviceStateRef, membership_authority: StoreOperationMembershipAuthority, input: StoreCommitOperationsInput<'_>, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source§

impl Signed<StoreBatchCommitBody>

Source

pub fn commit_hash(&self) -> ObjectHash

Source

pub fn verify_at( &self, expected_store_root_hash: ObjectHash, expected_coord: &StoreCommitCoord, author: &StoreDeviceRegistration, ) -> Result<(), StoreProtocolError>

Source

pub fn verify_store_package( &self, package_bytes: &[u8], ) -> Result<(), StoreProtocolError>

Source

pub fn verify_circle_package( &self, circle_id: CircleId, package_bytes: &[u8], ) -> Result<(), StoreProtocolError>

Source

pub fn operations_membership_authority( &self, ) -> Result<StoreOperationMembershipAuthority, StoreProtocolError>

Source§

impl Signed<StoreBatchCommitBody>

Source§

impl Signed<CircleAckBody>

Source

pub fn signed( store_root_hash: ObjectHash, circle_id: CircleId, registration: StoreDeviceRegistrationRef, sequence: u64, store_cut: CommitFrontier, control: CircleControlCoord, epoch_id: CircleEpochId, key_fingerprint: KeyFingerprint, seeded_from: Option<CircleBootstrapCoverageRef>, last_sync: String, successor: SuccessorLink, device_signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn ack_hash(&self) -> ObjectHash

Source

pub fn parse_at( bytes: &[u8], expected_store_root: &StoreRootRef, expected: &CircleAckRef, author: &StoreDeviceRegistration, ) -> Result<Self, StoreProtocolError>

Verify one exact Circle acknowledgement against its expected reference and author registration. The successor’s stream activation is not recomputed here: a Circle-acknowledgement stream’s first slot is not carried by the author’s registration (unlike a Store-acknowledgement stream), so only the author that holds it can reproduce the activation. A reader trusts the Store commit that named this acknowledgement as the sole activation authority, and checks the predecessor/sequence chain for ordering.

Source§

impl Signed<CircleSnapshotMetaBody>

Source

pub fn signed( store_root_hash: ObjectHash, circle_id: CircleId, author_registration: StoreDeviceRegistrationRef, control: CircleControlCoord, epoch_id: CircleEpochId, key_fingerprint: KeyFingerprint, generation: u64, bootstrap: CircleBootstrapRef, created_at: String, successor: CircleSnapshotSuccessorLink, device_signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn snapshot_hash(&self) -> ObjectHash

Source

pub fn semantic_hash_from_bytes( bytes: &[u8], ) -> Result<ObjectHash, StoreProtocolError>

Source

pub fn parse_at( bytes: &[u8], expected_store_root_hash: ObjectHash, expected: &CircleSnapshotRef, author: &StoreDeviceRegistration, ) -> Result<Self, StoreProtocolError>

Verify one exact Circle snapshot against its expected reference and author registration. The successor’s stream activation is not recomputed here: a Circle snapshot stream has no per-(device, Circle) first slot in the registration for a reader to derive, so the create-once successor slot and predecessor chain establish stream position, exactly as the Circle acknowledgement stream does.

Source§

impl Signed<DeviceReadinessProofBody>

Source

pub fn signed( attempt_id: DeviceJoinAttemptId, registration: StoreDeviceRegistrationRef, initial_ack: StoreAckRef, bootstrap_cut: StoreHistoryCut, registration_value: &StoreDeviceRegistration, device_signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn verify( &self, attempt_id: DeviceJoinAttemptId, attempt_cut: &StoreHistoryCut, registration: &StoreDeviceRegistration, initial_ack_ref: &StoreAckRef, initial_ack: &StoreAck, ) -> Result<(), StoreProtocolError>

Check a readiness proof against the attempt commit it answers.

attempt_cut is that commit’s predecessor cut — the history the admitting device declared the joining device would install from. The joiner echoes it here, so the two have to agree.

Source§

impl Signed<DeviceJoinOfferBody>

Source

pub fn signed( attempt_id: DeviceJoinAttemptId, member_pubkey: String, store_root: StoreRootRef, provider: StoreProviderBinding, owner_registration: StoreDeviceRegistrationRef, owner_grant: MembershipGrantId, provider_admin: ProviderAdminGrantRecord, owner: &StoreDeviceRegistration, owner_device_signer: &UserKeypair, ) -> Result<Self, DeviceJoinExchangeError>

Source

pub fn verify( &self, owner: &StoreDeviceRegistration, ) -> Result<(), DeviceJoinExchangeError>

Source§

impl Signed<DeviceProviderAccessRequestBody>

Source

pub fn signed( offer: DeviceJoinOffer, peer_provider: ProviderDeviceBinding, expected_registration: StoreDeviceRegistration, registration_slot: ObjectSlot, member_signer: &UserKeypair, ) -> Result<Self, DeviceJoinExchangeError>

Source

pub fn verify( &self, owner: &StoreDeviceRegistration, ) -> Result<(), DeviceJoinExchangeError>

Source

pub fn request_hash(&self) -> ObjectHash

Source

pub fn cross_challenge_context(&self) -> CrossPrincipalChallengeContext

Source§

impl Signed<DeviceProviderAdmissionApprovalBody>

Source

pub fn access_grant(&self) -> Option<&ActivatedStoreMemberProviderAccessGrant>

Source

pub fn signed( request: DeviceProviderAccessRequest, admission: DeviceProviderAdmission, store_root: &VerifiedObject<StoreProtocolRoot>, owner: &StoreDeviceRegistration, owner_device_signer: &UserKeypair, ) -> Result<Self, DeviceJoinExchangeError>

Source

pub fn verify( &self, store_root: &VerifiedObject<StoreProtocolRoot>, owner: &StoreDeviceRegistration, ) -> Result<(), DeviceJoinExchangeError>

One registration answers the whole approval: the device that signed the offer is the device that holds the store’s provider-administrator grant, so it is also the signer of this approval and of the access grant inside it.

Source

pub fn signed_without_shape_validation_for_test( request: DeviceProviderAccessRequest, admission: DeviceProviderAdmission, owner_device_signer: &UserKeypair, ) -> Self

Source§

impl Signed<DeviceJoinAbandonmentBody>

Source

pub fn signed( offer: &DeviceJoinOffer, owner: &StoreDeviceRegistration, owner_device_signer: &UserKeypair, ) -> Result<Self, DeviceJoinExchangeError>

Source

pub fn abandonment_hash(&self) -> ObjectHash

Source§

impl Signed<StoreDeviceExclusionProposalBody>

Source

pub fn signed( store_root_hash: ObjectHash, proposal_id: StoreDeviceExclusionProposalId, target: StoreDeviceRegistrationRef, target_registration: &StoreDeviceRegistration, frozen_device_state: StoreDeviceStateRef, outcome_slot: ObjectSlot, owner_registration: StoreDeviceRegistrationRef, owner_grant: MembershipGrantId, owner: &StoreDeviceRegistration, owner_device_signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn proposal_hash(&self) -> ObjectHash

Source

pub fn parse_at( bytes: &[u8], expected: &StoreDeviceExclusionProposalRef, target: &StoreDeviceRegistration, owner: &StoreDeviceRegistration, ) -> Result<Self, StoreProtocolError>

Source§

impl Signed<StoreDeviceExclusionCancellationBody>

Source

pub fn signed( proposal: StoreDeviceExclusionProposalRef, proposal_value: &StoreDeviceExclusionProposal, owner_registration: StoreDeviceRegistrationRef, owner_grant: MembershipGrantId, owner: &StoreDeviceRegistration, owner_device_signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn outcome_hash(&self) -> ObjectHash

Source§

impl Signed<StoreDeviceExclusionBody>

Source

pub fn signed( proposal: StoreDeviceExclusionProposalRef, proposal_value: &StoreDeviceExclusionProposal, target: StoreDeviceRegistrationRef, target_registration: &StoreDeviceRegistration, proof: StoreDeviceExclusionProof, owner_registration: StoreDeviceRegistrationRef, owner_grant: MembershipGrantId, owner: &StoreDeviceRegistration, owner_device_signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn outcome_hash(&self) -> ObjectHash

Source§

impl Signed<StoreDeviceHeadBody>

Source

pub fn signed( store_root_hash: ObjectHash, author_registration: StoreDeviceRegistrationRef, commit: StoreBatchCommitRef, successor: SuccessorLink, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn head_hash(&self) -> ObjectHash

Source

pub fn slot_sequence(&self) -> u64

Source

pub fn signature_is_valid_for( &self, expected_registration: &StoreDeviceRegistration, ) -> bool

Source

pub fn parse_at( bytes: &[u8], expected_store_root_hash: ObjectHash, expected_registration: &StoreDeviceRegistration, expected_ref: &StoreBatchCommitRef, ) -> Result<Self, StoreProtocolError>

Source§

impl Signed<MembershipRollupBody>

Source

pub fn signed( store_root_hash: ObjectHash, author_registration: StoreDeviceRegistrationRef, streams: Vec<MembershipRollupStream>, resolutions: Vec<MembershipRollupResolution>, device_signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn validate_shape(&self) -> Result<(), StoreProtocolError>

Everything about a rollup that can be checked without the chain: each carried object hashes to the reference that names it, carries its own author’s signature, and sits at the coordinate its stream claims.

This is deliberately not the whole of membership verification — grant authority, predecessor linkage across a conflict layer, and Store-commit activation are decided by the walk that consumes these bytes, over the same code path that decides them for bytes read off the provider. What this establishes is that the rollup is a faithful carrier: every object in it is the object its reference names.

Source

pub fn parse_at( bytes: &[u8], expected_store_root_hash: ObjectHash, expected: &MembershipRollupRef, author: &StoreDeviceRegistration, ) -> Result<Self, StoreProtocolError>

Source§

impl Signed<OwnerPromotionRequestBody>

Source

pub fn signed( promotion_id: OwnerPromotionId, root: &StoreRootRef, promoter_registration: StoreDeviceRegistrationRef, promoter: &StoreDeviceRegistration, promoter_owner_grant: MembershipGrantId, member_pubkey: String, member_grant: MembershipGrantId, member_registration: StoreDeviceRegistrationRef, predecessor_membership: StoreMembershipStateRef, predecessor_devices: StoreDeviceStateRef, finalization: OwnerPromotionFinalization, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn verify( &self, root: &StoreRootRef, promoter: &StoreDeviceRegistration, ) -> Result<(), StoreProtocolError>

Source§

impl Signed<OwnerPromotionAcceptanceBody>

Source§

impl Signed<OwnerConflictResolutionAcceptanceBody>

Source

pub fn signed( store_root_hash: ObjectHash, owner_grant: MembershipGrantId, owner_registration: StoreDeviceRegistrationRef, membership: GrantStreamAnchor, recovery: GrantStreamAnchor, device_state: StoreDeviceStateRef, registration: &StoreDeviceRegistration, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn verify( &self, registration: &StoreDeviceRegistration, ) -> Result<(), StoreProtocolError>

Source§

impl Signed<StoreProtocolRootBody>

Source

pub fn signed( descriptor: StoreCreationDescriptor, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn object_hash(&self) -> ObjectHash

Source

pub fn parse(bytes: &[u8]) -> Result<Self, StoreProtocolError>

Source

pub fn parse_expected( bytes: &[u8], expected: &StoreRootRef, expected_sync_routing_hash: ObjectHash, ) -> Result<Self, StoreProtocolError>

Source

pub fn parse_pinned( bytes: &[u8], expected: &StoreRootRef, ) -> Result<Self, StoreProtocolError>

Source§

impl Signed<StorePublicationEntryBody>

Source

pub fn signed_commit( current: &StoreCurrentPublicationRecord, commit: &VerifiedStoreBatchCommit, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn signed_snapshot( current: &StoreCurrentPublicationRecord, author_registration: StoreDeviceRegistrationRef, snapshot: StoreSnapshotRef, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn entry_hash(&self) -> ObjectHash

Source

pub fn parse_at( bytes: &[u8], expected_store_root_hash: ObjectHash, reference: &StorePublicationRef, expected_signing_pubkey: &str, ) -> Result<Self, StoreProtocolError>

Source

pub fn verify_published_commit( &self, commit: &VerifiedStoreBatchCommit, publisher_signing_pubkey: &str, ) -> Result<(), StoreProtocolError>

Source§

impl Signed<StoreCurrentPublicationRecordBody>

Source

pub fn genesis(store_root_hash: ObjectHash, founder: &UserKeypair) -> Self

Source

pub fn advance_commit( previous: &Self, entry: &StorePublicationEntry, reference: StorePublicationRef, commit: &VerifiedStoreBatchCommit, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn advance_snapshot( previous: &Self, entry: &StorePublicationEntry, reference: StorePublicationRef, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn record_hash(&self) -> ObjectHash

Source

pub fn accepted(&self) -> Option<&StorePublicationRef>

Source

pub fn latest_snapshot(&self) -> Option<&AcceptedStoreSnapshotRef>

Source

pub fn publication_base(&self) -> StorePublicationBase

Source

pub fn next_position( &self, ) -> Result<StorePublicationPosition, StoreProtocolError>

Source

pub fn verify_genesis( &self, expected_store_root_hash: ObjectHash, founder_pubkey: &str, ) -> Result<(), StoreProtocolError>

Source

pub fn verify_commit_transition( &self, previous: &Self, entry: &StorePublicationEntry, reference: &StorePublicationRef, commit: &VerifiedStoreBatchCommit, publisher_signing_pubkey: &str, ) -> Result<(), StoreProtocolError>

Source

pub fn verify_accepted_commit( &self, entry: &StorePublicationEntry, reference: &StorePublicationRef, commit: &VerifiedStoreBatchCommit, publisher_signing_pubkey: &str, ) -> Result<(), StoreProtocolError>

Source§

impl Signed<OwnerRecoveryNodeBody>

Source

pub fn signed( store_root_hash: ObjectHash, recovery_id: DeviceRecoveryId, owner_grant: MembershipGrantId, sequence: u64, membership: StoreMembershipStateRef, predecessor: Option<OwnerRecoveryNodeRef>, readiness: DeviceRecoveryReadiness, next_slot: ObjectSlot, owner_signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>

Source

pub fn parse_at( bytes: &[u8], store_root: &StoreRootRef, reference: &OwnerRecoveryNodeRef, ) -> Result<Self, StoreProtocolError>

Source

pub fn node_hash(&self) -> ObjectHash

Source§

impl Signed<StoreDeviceRegistrationBody>

Source§

impl<T: SignedBody> Signed<T>

Source

pub fn verify_by(&self, public_key: &str) -> Result<(), StoreProtocolError>

Check the signature against public_key, refusing a version this build does not read before spending a verification on it.

Source

pub fn body_mut(&mut self) -> &mut T

The body, mutable, leaving the signature over whatever it held before. A draft artifact is built against objects whose slots are only allocated later, so its body is edited into final form and then Self::resigned; a test uses this to build the tampered forms a verifier has to reject. Every reader of the value between the two calls sees a signature that does not check out. The cached digest goes with the old body: the next hash, verification, or re-signing is taken over the bytes as edited.

Source

pub fn resign<A: IdentityKeyAuthority + ?Sized>(&mut self, signer: &A)

Sign the body this value now holds, replacing any earlier signature. The signature is not part of what the digest covers, so an artifact signed again is still identified by the same hash.

Source

pub fn corrupt_signature_for_test(&mut self)

Damage the signature so verification fails, for tests that assert a verifier refuses an artifact whose signature does not check out.

Source§

impl<T> Signed<T>

Source

pub fn unsigned_for_test(body: T) -> Self

An envelope carrying no signature, for tests that need an artifact’s shape somewhere no verifier reads it.

Source§

impl<T: Serialize> Signed<T>

Source

pub fn to_bytes(&self) -> Vec<u8>

Trait Implementations§

Source§

impl<T: Clone> Clone for Signed<T>

Source§

fn clone(&self) -> Signed<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for Signed<T>

Printed like the three fields that make up the artifact, so that two values that compare equal also read the same regardless of whether either has been hashed yet.

Source§

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

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

impl<T> Deref for Signed<T>

Reading a signed artifact’s fields reads its body. The envelope’s own parts — the version and the signature — are reached through its methods, so a body field can never be shadowed by one of them.

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &T

Dereferences the value.
Source§

impl<'de, T> Deserialize<'de> for Signed<T>
where T: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<T: PartialEq> PartialEq for Signed<T>

Two signed artifacts are the same artifact when they were written under the same version, carry the same body, and bear the same signature. The cached digest is a function of the first two, so it says nothing equality does not.

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> Serialize for Signed<T>
where T: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<T: Eq> Eq for Signed<T>

Auto Trait Implementations§

§

impl<T> !Freeze for Signed<T>

§

impl<T> RefUnwindSafe for Signed<T>
where T: RefUnwindSafe,

§

impl<T> Send for Signed<T>
where T: Send,

§

impl<T> Sync for Signed<T>
where T: Sync,

§

impl<T> Unpin for Signed<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for Signed<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for Signed<T>
where T: UnwindSafe,

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<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<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
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

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

§

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

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

§

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