pub struct Blake3KeyedSigner { /* private fields */ }Expand description
BLAKE3 keyed signer for authenticated high-throughput content.
Uses signature type code SIGNATURE_TYPE_DIGEST_BLAKE3_KEYED (7),
reserved on the NDN TLV SignatureType registry, distinct from the plain
BLAKE3 code on purpose (see the plain-vs-keyed rationale on the type code
constants above). Uses a 32-byte secret key with BLAKE3’s built-in keyed
hashing mode — faster than HMAC-SHA256 while providing equivalent security
guarantees.
Implementations§
Source§impl Blake3KeyedSigner
impl Blake3KeyedSigner
Sourcepub fn new(key: [u8; 32], key_name: Name) -> Self
pub fn new(key: [u8; 32], key_name: Name) -> Self
Create from an exact 32-byte key. The SignatureBlake3Keyed spec
(docs/wiki/src/reference/blake3-signature-spec.md) requires keys
to be exactly 32 octets; the [u8; 32] argument enforces this at
compile time, eliminating any silent padding or truncation that
would let a caller weaken the MAC by accident.
Trait Implementations§
Source§impl Signer for Blake3KeyedSigner
impl Signer for Blake3KeyedSigner
fn sig_type(&self) -> SignatureType
fn key_name(&self) -> &Name
fn sign<'a>( &'a self, region: &'a [u8], ) -> Pin<Box<dyn Future<Output = Result<Bytes, TrustError>> + Send + 'a>>
Source§fn sign_sync(&self, region: &[u8]) -> Result<Bytes, TrustError>
fn sign_sync(&self, region: &[u8]) -> Result<Bytes, TrustError>
Synchronous signing — avoids
Box::pin and async state machine overhead. Read moreSource§fn cert_name(&self) -> Option<&Name>
fn cert_name(&self) -> Option<&Name>
The certificate name to embed as a key locator in SignatureInfo, if any.
Source§fn public_key(&self) -> Option<Bytes>
fn public_key(&self) -> Option<Bytes>
Return the raw public key bytes, if available.
Auto Trait Implementations§
impl !Freeze for Blake3KeyedSigner
impl RefUnwindSafe for Blake3KeyedSigner
impl Send for Blake3KeyedSigner
impl Sync for Blake3KeyedSigner
impl Unpin for Blake3KeyedSigner
impl UnwindSafe for Blake3KeyedSigner
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