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>
impl Signed<CircleAccessLeafBody>
pub fn verify_signature(&self) -> bool
Source§impl Signed<CircleControlBody>
impl Signed<CircleControlBody>
pub fn control_hash(&self) -> ObjectHash
pub fn causally_covers(&self, prior: &Self) -> bool
pub fn verify(&self) -> bool
pub fn coord(&self) -> CircleControlCoord
Source§impl Signed<CircleControlHeadBody>
impl Signed<CircleControlHeadBody>
pub fn signed( control: &CircleControl, entry: ExactObjectRef, successor: SuccessorLink, signer: &UserKeypair, ) -> Self
pub fn head_hash(&self) -> ObjectHash
pub fn verify(&self, registration: &StoreDeviceRegistration) -> bool
Source§impl Signed<AccessEnvelopeBody>
impl Signed<AccessEnvelopeBody>
pub fn verify( &self, control: &PreparedCircleControl, candidate_family: CandidateFamilyId, ) -> bool
Source§impl Signed<CircleEpochCloseIntentBody>
impl Signed<CircleEpochCloseIntentBody>
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>
pub fn verify(&self) -> bool
pub fn intent_hash(&self) -> ObjectHash
Source§impl Signed<CircleEpochCloseResponseBody>
impl Signed<CircleEpochCloseResponseBody>
pub fn signed( control: &PreparedCircleControl, registration: StoreDeviceRegistrationRef, frontier: CommitFrontier, author: &StoreDeviceRegistration, signer: &UserKeypair, ) -> Result<Self, CircleTransitionError>
pub fn verify_for( &self, control: &PreparedCircleControl, author: &StoreDeviceRegistration, ) -> bool
Source§impl Signed<CircleEpochCloseExclusionBody>
impl Signed<CircleEpochCloseExclusionBody>
pub fn signed( control: &PreparedCircleControl, excluded: StoreDeviceRegistrationRef, signer: &dyn IdentityKeyAuthority, ) -> Result<Self, CircleTransitionError>
pub fn verify_for(&self, control: &PreparedCircleControl) -> bool
Source§impl Signed<CircleEpochCloseOutcomeBody>
impl Signed<CircleEpochCloseOutcomeBody>
pub fn signed( control: &PreparedCircleControl, intent: &CircleEpochCloseIntent, responses: Vec<CircleEpochCloseSettlement>, successor: CircleEpochSuccessor, signer: &dyn IdentityKeyAuthority, ) -> Result<Self, CircleTransitionError>
pub fn verify_for( &self, control: &PreparedCircleControl, intent: &CircleEpochCloseIntent, settlements: &[(CircleEpochCloseSettlement, CircleEpochCloseResponseSlotValue)], ) -> bool
pub fn verify_signature(&self) -> bool
pub fn outcome_hash(&self) -> ObjectHash
Source§impl Signed<CircleEpochCloseCancellationBody>
impl Signed<CircleEpochCloseCancellationBody>
pub fn signed( control: &PreparedCircleControl, signer: &dyn IdentityKeyAuthority, ) -> Result<Self, CircleTransitionError>
pub fn verify_for(&self, control: &PreparedCircleControl) -> bool
pub fn verify_signature(&self) -> bool
pub fn cancellation_hash(&self) -> ObjectHash
Source§impl Signed<CircleMetadataBody>
impl Signed<CircleMetadataBody>
pub fn metadata_hash(&self) -> ObjectHash
pub fn coord(&self) -> CircleMetadataCoord
pub fn verify(&self) -> bool
Source§impl Signed<CircleMetadataHeadBody>
impl Signed<CircleMetadataHeadBody>
pub fn signed( metadata: &CircleMetadata, tip: ExactObjectRef, successor: SuccessorLink, signer: &UserKeypair, ) -> Self
pub fn head_hash(&self) -> ObjectHash
pub fn coord(&self) -> CircleMetadataCoord
pub fn verify_for_registration( &self, registration: &StoreDeviceRegistration, ) -> bool
Source§impl Signed<CircleRosterConflictResolutionBody>
impl Signed<CircleRosterConflictResolutionBody>
pub fn resolution_hash(&self) -> ObjectHash
pub fn resolution_ref(&self) -> CircleRosterConflictResolutionRef
pub fn verify_signature(&self) -> bool
Source§impl Signed<CircleRosterEntryBody>
impl Signed<CircleRosterEntryBody>
pub fn founder( store_root_hash: ObjectHash, circle_id: CircleId, device_id: &str, stream_id: AuthorStreamId, owner_grant: MembershipGrantId, signer: &dyn IdentityKeyAuthority, ) -> Self
pub fn coord(&self) -> CircleRosterCoord
pub fn verify(&self) -> bool
Source§impl Signed<CircleRosterHeadBody>
impl Signed<CircleRosterHeadBody>
pub fn signed( entry: &CircleRosterEntry, tip: ExactObjectRef, successor: SuccessorLink, signer: &UserKeypair, ) -> Self
pub fn head_hash(&self) -> ObjectHash
pub fn verify_for_registration( &self, registration: &StoreDeviceRegistration, ) -> bool
pub fn entry_coord(&self) -> CircleRosterCoord
Source§impl Signed<StoreMembershipConflictResolutionBody>
impl Signed<StoreMembershipConflictResolutionBody>
pub fn resolution_hash(&self) -> ObjectHash
pub fn resolution_ref( &self, object: ExactObjectRef, ) -> StoreMembershipConflictResolutionRef
pub fn verify_signature(&self) -> bool
Source§impl Signed<MembershipEntryBody>
impl Signed<MembershipEntryBody>
pub fn coord(&self) -> MembershipCoord
Source§impl Signed<AuthorHeadBody>
impl Signed<AuthorHeadBody>
pub fn signed( store_id: String, body: MembershipHeadBody, activation: MembershipHeadActivation, device_signer: &UserKeypair, ) -> Self
pub fn verify(&self, registration: &StoreDeviceRegistration) -> bool
pub fn entry_coord(&self) -> MembershipCoord
pub fn head_hash(&self) -> ObjectHash
Source§impl Signed<StoreMemberProviderAccessGrantBody>
impl Signed<StoreMemberProviderAccessGrantBody>
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>
pub fn grant_hash(&self) -> ObjectHash
pub fn verify( &self, store: &StoreProviderBinding, administrator: &StoreDeviceRegistration, ) -> Result<(), ProviderProbeError>
Source§impl Signed<ReclaimEvidenceBody>
impl Signed<ReclaimEvidenceBody>
pub fn signed( store_root_hash: ObjectHash, claim: ReclaimClaim, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>
pub fn evidence_hash(&self) -> ObjectHash
pub fn verify(&self) -> Result<(), StoreProtocolError>
Source§impl Signed<ReclaimAuthorizationBody>
impl Signed<ReclaimAuthorizationBody>
pub fn signed( store_root_hash: ObjectHash, target: ReclaimTarget, evidence: ReclaimEvidenceRef, authority: StoreReclaimAuthority, signer: &UserKeypair, ) -> Self
pub fn verify(&self, owner_pubkey: &str) -> Result<(), StoreProtocolError>
Source§impl Signed<ReclaimReceiptBody>
impl Signed<ReclaimReceiptBody>
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>
pub fn receipt_hash(&self) -> ObjectHash
pub fn verify( &self, executor: &StoreDeviceRegistration, ) -> Result<(), StoreProtocolError>
Source§impl Signed<StoreAckBody>
impl Signed<StoreAckBody>
pub fn signed( store_root_hash: ObjectHash, sequence: u64, assertion: StoreAckAssertion, last_sync: String, successor: SuccessorLink, device_signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>
pub fn ack_hash(&self) -> ObjectHash
pub fn semantic_hash_from_bytes( bytes: &[u8], ) -> Result<ObjectHash, StoreProtocolError>
pub fn parse_at( bytes: &[u8], expected_store_root: &StoreRootRef, expected: &StoreAckRef, author: &StoreDeviceRegistration, ) -> Result<Self, StoreProtocolError>
Source§impl Signed<SnapshotMetaBody>
impl Signed<SnapshotMetaBody>
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>
pub fn snapshot_hash(&self) -> ObjectHash
pub fn semantic_hash_from_bytes( bytes: &[u8], ) -> Result<ObjectHash, StoreProtocolError>
pub fn parse_at( bytes: &[u8], expected_store_root_hash: ObjectHash, expected: &StoreSnapshotRef, author: &StoreDeviceRegistration, ) -> Result<Self, StoreProtocolError>
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>
impl Signed<StoreBatchCommitBody>
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>
pub fn merge_dependencies( &self, ) -> &BTreeMap<AuthorStreamId, StoreBatchCommitRef>
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>
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>
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>
impl Signed<StoreBatchCommitBody>
pub fn commit_hash(&self) -> ObjectHash
pub fn verify_at( &self, expected_store_root_hash: ObjectHash, expected_coord: &StoreCommitCoord, author: &StoreDeviceRegistration, ) -> Result<(), StoreProtocolError>
pub fn verify_store_package( &self, package_bytes: &[u8], ) -> Result<(), StoreProtocolError>
pub fn verify_circle_package( &self, circle_id: CircleId, package_bytes: &[u8], ) -> Result<(), StoreProtocolError>
Source§impl Signed<StoreBatchCommitBody>
impl Signed<StoreBatchCommitBody>
pub fn seq(&self) -> u64
pub fn publication_base(&self) -> &StorePublicationBase
pub fn candidate_family(&self) -> CandidateFamilyId
pub fn operations(&self) -> Option<&StoreCommitOperations>
pub fn control(&self) -> Option<&StoreControl>
pub fn acknowledgement(&self) -> Option<&StoreAckRef>
pub fn circle_acknowledgements(&self) -> &[CircleAckRef]
pub fn retained_operation_objects( &self, ) -> Result<Vec<ExactObjectRef>, StoreProtocolError>
pub fn abandoned_candidates(&self) -> &[CandidateCleanupManifest]
pub fn reclaim_receipt(&self) -> Option<&ReclaimReceiptRef>
pub fn device_join_attempt_decisions(&self) -> &[DeviceJoinAttemptDecisionRef]
pub fn provider_access_grants(&self) -> &[StoreMemberProviderAccessGrantRef]
pub fn device_registrations(&self) -> &[ActivatedStoreDeviceRegistrationRef]
pub fn device_exclusion_proposals(&self) -> &[StoreDeviceExclusionProposalRef]
pub fn device_exclusion_outcomes(&self) -> &[StoreDeviceExclusionOutcomeRef]
pub fn stream_activations(&self) -> &[StreamActivation]
pub fn owner_promotion_request(&self) -> Option<&OwnerPromotionRequest>
pub fn circle_controls(&self) -> &[CircleControlRef]
pub fn store_package(&self) -> Option<&StorePackageRef>
pub fn circle_packages(&self) -> &[CirclePackageRef]
Source§impl Signed<CircleAckBody>
impl Signed<CircleAckBody>
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>
pub fn ack_hash(&self) -> ObjectHash
Sourcepub fn parse_at(
bytes: &[u8],
expected_store_root: &StoreRootRef,
expected: &CircleAckRef,
author: &StoreDeviceRegistration,
) -> Result<Self, StoreProtocolError>
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>
impl Signed<CircleSnapshotMetaBody>
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>
pub fn snapshot_hash(&self) -> ObjectHash
pub fn semantic_hash_from_bytes( bytes: &[u8], ) -> Result<ObjectHash, StoreProtocolError>
Sourcepub fn parse_at(
bytes: &[u8],
expected_store_root_hash: ObjectHash,
expected: &CircleSnapshotRef,
author: &StoreDeviceRegistration,
) -> Result<Self, StoreProtocolError>
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>
impl Signed<DeviceReadinessProofBody>
pub fn signed( attempt_id: DeviceJoinAttemptId, registration: StoreDeviceRegistrationRef, initial_ack: StoreAckRef, bootstrap_cut: StoreHistoryCut, registration_value: &StoreDeviceRegistration, device_signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>
Sourcepub fn verify(
&self,
attempt_id: DeviceJoinAttemptId,
attempt_cut: &StoreHistoryCut,
registration: &StoreDeviceRegistration,
initial_ack_ref: &StoreAckRef,
initial_ack: &StoreAck,
) -> Result<(), StoreProtocolError>
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>
impl Signed<DeviceJoinOfferBody>
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>
pub fn verify( &self, owner: &StoreDeviceRegistration, ) -> Result<(), DeviceJoinExchangeError>
Source§impl Signed<DeviceProviderAccessRequestBody>
impl Signed<DeviceProviderAccessRequestBody>
pub fn signed( offer: DeviceJoinOffer, peer_provider: ProviderDeviceBinding, expected_registration: StoreDeviceRegistration, registration_slot: ObjectSlot, member_signer: &UserKeypair, ) -> Result<Self, DeviceJoinExchangeError>
pub fn verify( &self, owner: &StoreDeviceRegistration, ) -> Result<(), DeviceJoinExchangeError>
pub fn request_hash(&self) -> ObjectHash
pub fn cross_challenge_context(&self) -> CrossPrincipalChallengeContext
Source§impl Signed<DeviceProviderAdmissionApprovalBody>
impl Signed<DeviceProviderAdmissionApprovalBody>
pub fn access_grant(&self) -> Option<&ActivatedStoreMemberProviderAccessGrant>
pub fn signed( request: DeviceProviderAccessRequest, admission: DeviceProviderAdmission, store_root: &VerifiedObject<StoreProtocolRoot>, owner: &StoreDeviceRegistration, owner_device_signer: &UserKeypair, ) -> Result<Self, DeviceJoinExchangeError>
Sourcepub fn verify(
&self,
store_root: &VerifiedObject<StoreProtocolRoot>,
owner: &StoreDeviceRegistration,
) -> Result<(), DeviceJoinExchangeError>
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.
pub fn signed_without_shape_validation_for_test( request: DeviceProviderAccessRequest, admission: DeviceProviderAdmission, owner_device_signer: &UserKeypair, ) -> Self
Source§impl Signed<DeviceJoinAbandonmentBody>
impl Signed<DeviceJoinAbandonmentBody>
pub fn signed( offer: &DeviceJoinOffer, owner: &StoreDeviceRegistration, owner_device_signer: &UserKeypair, ) -> Result<Self, DeviceJoinExchangeError>
pub fn abandonment_hash(&self) -> ObjectHash
Source§impl Signed<StoreDeviceExclusionProposalBody>
impl Signed<StoreDeviceExclusionProposalBody>
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>
pub fn proposal_hash(&self) -> ObjectHash
pub fn parse_at( bytes: &[u8], expected: &StoreDeviceExclusionProposalRef, target: &StoreDeviceRegistration, owner: &StoreDeviceRegistration, ) -> Result<Self, StoreProtocolError>
Source§impl Signed<StoreDeviceExclusionCancellationBody>
impl Signed<StoreDeviceExclusionCancellationBody>
pub fn signed( proposal: StoreDeviceExclusionProposalRef, proposal_value: &StoreDeviceExclusionProposal, owner_registration: StoreDeviceRegistrationRef, owner_grant: MembershipGrantId, owner: &StoreDeviceRegistration, owner_device_signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>
pub fn outcome_hash(&self) -> ObjectHash
Source§impl Signed<StoreDeviceExclusionBody>
impl Signed<StoreDeviceExclusionBody>
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>
pub fn outcome_hash(&self) -> ObjectHash
Source§impl Signed<StoreDeviceHeadBody>
impl Signed<StoreDeviceHeadBody>
pub fn signed( store_root_hash: ObjectHash, author_registration: StoreDeviceRegistrationRef, commit: StoreBatchCommitRef, successor: SuccessorLink, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>
pub fn head_hash(&self) -> ObjectHash
pub fn slot_sequence(&self) -> u64
pub fn signature_is_valid_for( &self, expected_registration: &StoreDeviceRegistration, ) -> bool
pub fn parse_at( bytes: &[u8], expected_store_root_hash: ObjectHash, expected_registration: &StoreDeviceRegistration, expected_ref: &StoreBatchCommitRef, ) -> Result<Self, StoreProtocolError>
Source§impl Signed<MembershipRollupBody>
impl Signed<MembershipRollupBody>
pub fn signed( store_root_hash: ObjectHash, author_registration: StoreDeviceRegistrationRef, streams: Vec<MembershipRollupStream>, resolutions: Vec<MembershipRollupResolution>, device_signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>
Sourcepub fn validate_shape(&self) -> Result<(), StoreProtocolError>
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.
pub fn parse_at( bytes: &[u8], expected_store_root_hash: ObjectHash, expected: &MembershipRollupRef, author: &StoreDeviceRegistration, ) -> Result<Self, StoreProtocolError>
Source§impl Signed<OwnerPromotionRequestBody>
impl Signed<OwnerPromotionRequestBody>
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>
pub fn verify( &self, root: &StoreRootRef, promoter: &StoreDeviceRegistration, ) -> Result<(), StoreProtocolError>
Source§impl Signed<OwnerPromotionAcceptanceBody>
impl Signed<OwnerPromotionAcceptanceBody>
pub fn signed( request: OwnerPromotionRequest, activation: OwnerPromotionRequestActivation, anchors: OwnerPromotionAnchors, candidate: &StoreDeviceRegistration, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>
pub fn verify( &self, candidate: &StoreDeviceRegistration, ) -> Result<(), StoreProtocolError>
Source§impl Signed<OwnerConflictResolutionAcceptanceBody>
impl Signed<OwnerConflictResolutionAcceptanceBody>
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>
pub fn verify( &self, registration: &StoreDeviceRegistration, ) -> Result<(), StoreProtocolError>
Source§impl Signed<StoreProtocolRootBody>
impl Signed<StoreProtocolRootBody>
pub fn signed( descriptor: StoreCreationDescriptor, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>
pub fn object_hash(&self) -> ObjectHash
pub fn parse(bytes: &[u8]) -> Result<Self, StoreProtocolError>
pub fn parse_expected( bytes: &[u8], expected: &StoreRootRef, expected_sync_routing_hash: ObjectHash, ) -> Result<Self, StoreProtocolError>
pub fn parse_pinned( bytes: &[u8], expected: &StoreRootRef, ) -> Result<Self, StoreProtocolError>
Source§impl Signed<StorePublicationEntryBody>
impl Signed<StorePublicationEntryBody>
pub fn signed_commit( current: &StoreCurrentPublicationRecord, commit: &VerifiedStoreBatchCommit, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>
pub fn signed_snapshot( current: &StoreCurrentPublicationRecord, author_registration: StoreDeviceRegistrationRef, snapshot: StoreSnapshotRef, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>
pub fn entry_hash(&self) -> ObjectHash
pub fn parse_at( bytes: &[u8], expected_store_root_hash: ObjectHash, reference: &StorePublicationRef, expected_signing_pubkey: &str, ) -> Result<Self, StoreProtocolError>
pub fn verify_published_commit( &self, commit: &VerifiedStoreBatchCommit, publisher_signing_pubkey: &str, ) -> Result<(), StoreProtocolError>
Source§impl Signed<StoreCurrentPublicationRecordBody>
impl Signed<StoreCurrentPublicationRecordBody>
pub fn genesis(store_root_hash: ObjectHash, founder: &UserKeypair) -> Self
pub fn advance_commit( previous: &Self, entry: &StorePublicationEntry, reference: StorePublicationRef, commit: &VerifiedStoreBatchCommit, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>
pub fn advance_snapshot( previous: &Self, entry: &StorePublicationEntry, reference: StorePublicationRef, signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>
pub fn record_hash(&self) -> ObjectHash
pub fn accepted(&self) -> Option<&StorePublicationRef>
pub fn latest_snapshot(&self) -> Option<&AcceptedStoreSnapshotRef>
pub fn publication_base(&self) -> StorePublicationBase
pub fn next_position( &self, ) -> Result<StorePublicationPosition, StoreProtocolError>
pub fn verify_genesis( &self, expected_store_root_hash: ObjectHash, founder_pubkey: &str, ) -> Result<(), StoreProtocolError>
pub fn verify_commit_transition( &self, previous: &Self, entry: &StorePublicationEntry, reference: &StorePublicationRef, commit: &VerifiedStoreBatchCommit, publisher_signing_pubkey: &str, ) -> Result<(), StoreProtocolError>
pub fn verify_accepted_commit( &self, entry: &StorePublicationEntry, reference: &StorePublicationRef, commit: &VerifiedStoreBatchCommit, publisher_signing_pubkey: &str, ) -> Result<(), StoreProtocolError>
Source§impl Signed<OwnerRecoveryNodeBody>
impl Signed<OwnerRecoveryNodeBody>
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>
pub fn parse_at( bytes: &[u8], store_root: &StoreRootRef, reference: &OwnerRecoveryNodeRef, ) -> Result<Self, StoreProtocolError>
pub fn node_hash(&self) -> ObjectHash
Source§impl Signed<StoreDeviceRegistrationBody>
impl Signed<StoreDeviceRegistrationBody>
pub fn store_announcement_activation( &self, reference: &StoreDeviceRegistrationRef, ) -> Result<StreamActivation, StoreProtocolError>
pub fn store_acknowledgement_activation( &self, reference: &StoreDeviceRegistrationRef, ) -> Result<StreamActivation, StoreProtocolError>
pub fn store_snapshot_activation( &self, reference: &StoreDeviceRegistrationRef, ) -> Result<StreamActivation, StoreProtocolError>
pub fn signed( store_root: StoreRootRef, origin: StoreDeviceRegistrationOrigin, provider: ProviderDeviceBinding, store_commits: DeviceStreamAnchor, acknowledgements: DeviceStreamAnchor, snapshots: DeviceStreamAnchor, identity_signer: &UserKeypair, ) -> Result<Self, StoreProtocolError>
pub fn device_signer( &self, identity_signer: &UserKeypair, ) -> Result<UserKeypair, StoreProtocolError>
pub fn registration_hash(&self) -> ObjectHash
pub fn parse_at( bytes: &[u8], expected_store_root: &StoreRootRef, expected_device: StoreDeviceId, ) -> Result<Self, StoreProtocolError>
Source§impl<T: SignedBody> Signed<T>
impl<T: SignedBody> Signed<T>
Sourcepub fn verify_by(&self, public_key: &str) -> Result<(), StoreProtocolError>
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.
Sourcepub fn body_mut(&mut self) -> &mut T
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.
Sourcepub fn resign<A: IdentityKeyAuthority + ?Sized>(&mut self, signer: &A)
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.
Sourcepub fn corrupt_signature_for_test(&mut self)
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>
impl<T> Signed<T>
Sourcepub fn unsigned_for_test(body: T) -> Self
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.
Trait Implementations§
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.
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§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.
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§impl<'de, T> Deserialize<'de> for Signed<T>where
T: Deserialize<'de>,
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>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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.
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.
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> 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.