Struct SigningIdentity
pub struct SigningIdentity {
pub public_key: Ed25519PublicKey,
pub attestation_id: AttestationId,
/* private fields */
}Expand description
Identity-side handle used by CollaborationManager::send_signed_op
to mint signed envelopes. The secret key stays private — not
re-exported on the manager’s public surface — so app code can only
sign via the manager’s helper, never handle the raw secret.
Fields§
§public_key: Ed25519PublicKeyPublic half — embedded as the author field on every signed op.
attestation_id: AttestationIdRole attestation the broker looks up ops against. One identity may hold attestations on multiple channels; this pins to one per manager.
Implementations§
§impl SigningIdentity
impl SigningIdentity
pub fn new(
secret_key: SigningKey,
attestation_id: AttestationId,
) -> SigningIdentity
pub fn new( secret_key: SigningKey, attestation_id: AttestationId, ) -> SigningIdentity
Construct an identity from a fresh keypair and the attestation id that authorises it. Mostly used in tests; production code builds via the shell-side identity-loading helper.
pub fn sign_op(
&mut self,
payload: Vec<u8>,
artifact: ArtifactId,
kind: OpKind,
) -> Result<SignedOp, SignedSendError>
pub fn sign_op( &mut self, payload: Vec<u8>, artifact: ArtifactId, kind: OpKind, ) -> Result<SignedOp, SignedSendError>
Build a fresh SignedOp envelope wrapping payload, bumping the
internal seq so callers don’t need to track sequence numbers.
§Errors
Returns SignedSendError::SequenceExhausted rather than ever reusing
a sequence number, or SignedSendError::Canonical when payload
fails to canonicalize for signing.
Auto Trait Implementations§
impl Freeze for SigningIdentity
impl RefUnwindSafe for SigningIdentity
impl Send for SigningIdentity
impl Sync for SigningIdentity
impl Unpin for SigningIdentity
impl UnsafeUnpin for SigningIdentity
impl UnwindSafe for SigningIdentity
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more