pub struct StaticTrust { /* private fields */ }Expand description
Pre-configured single Ed25519 public key. Accepts packages from any manufacturer as long as they verify against this key.
Intended for dev / air-gapped / self-hosted deployments where the
manufacturer’s public key is shipped alongside the package (typically as
public-key.json) instead of queried from a registry.
Implementations§
Source§impl StaticTrust
impl StaticTrust
Sourcepub fn new(pubkey: impl AsRef<[u8]>) -> Result<Self, HyperError>
pub fn new(pubkey: impl AsRef<[u8]>) -> Result<Self, HyperError>
Construct from 32 raw Ed25519 public key bytes.
Sourcepub fn dev_only() -> Self
pub fn dev_only() -> Self
Development-only trust provider seeded with an all-zero Ed25519 public
key. Accepts no real package (signatures against a zero key always
fail), but lets test and example code wire a valid TrustProvider
without pulling a real key file.
Never use in production — the only reason this exists is so
Node::from_config_file can distinguish an explicit opt-in to dev
mode from a missing trust configuration (which is a hard error).
Emits no warning of its own; callers should log at their discretion
(Node::from_config_file emits a tracing::warn! when it selects
this provider from a kind = "dev_only" config entry).
Trait Implementations§
Source§impl Clone for StaticTrust
impl Clone for StaticTrust
Source§fn clone(&self) -> StaticTrust
fn clone(&self) -> StaticTrust
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StaticTrust
impl Debug for StaticTrust
Source§impl TrustProvider for StaticTrust
impl TrustProvider for StaticTrust
fn verify_package<'life0, 'life1, 'async_trait>(
&'life0 self,
bytes: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<VerifiedPackage, HyperError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Auto Trait Implementations§
impl Freeze for StaticTrust
impl RefUnwindSafe for StaticTrust
impl Send for StaticTrust
impl Sync for StaticTrust
impl Unpin for StaticTrust
impl UnsafeUnpin for StaticTrust
impl UnwindSafe for StaticTrust
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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