pub struct LabelSigner { /* private fields */ }Expand description
A signer that can produce signatures for labels.
In v0.2.0, this uses a placeholder HMAC-SHA256 implementation. A future version will support ed25519/secp256k1 per the AT Protocol spec.
Implementations§
Source§impl LabelSigner
impl LabelSigner
Sourcepub fn from_base64(encoded: &str) -> Result<Self>
pub fn from_base64(encoded: &str) -> Result<Self>
Create a signer from a base64-encoded key string.
Note: This is a placeholder that treats the encoded string as raw bytes. A production implementation would perform proper base64 decoding.
Sourcepub fn sign(&self, label: &Label) -> Result<String>
pub fn sign(&self, label: &Label) -> Result<String>
Sign a label, returning the base64-encoded signature.
The signing process:
- Serialize the label to canonical CBOR (excluding the
sigfield) - Sign the CBOR bytes with the private key
- Return base64-encoded signature
Note: This is a placeholder implementation using a simple hash. Production use requires ed25519 or secp256k1 signing over CBOR.
Auto Trait Implementations§
impl Freeze for LabelSigner
impl RefUnwindSafe for LabelSigner
impl Send for LabelSigner
impl Sync for LabelSigner
impl Unpin for LabelSigner
impl UnsafeUnpin for LabelSigner
impl UnwindSafe for LabelSigner
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
§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>
Converts
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>
Converts
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