pub struct JwtKeys { /* private fields */ }Expand description
Holds the JWT encoding and decoding keys derived from an Ed25519 seed.
Implementations§
Source§impl JwtKeys
impl JwtKeys
Sourcepub fn from_ed25519_bytes(
private_bytes: &[u8; 32],
audience: &str,
) -> Result<Self, AppError>
pub fn from_ed25519_bytes( private_bytes: &[u8; 32], audience: &str, ) -> Result<Self, AppError>
Create JWT keys from raw 32-byte Ed25519 private key bytes.
audience is the expected JWT audience claim (e.g., “VTA” or “VTC”).
Computes the public key and wraps both in DER format as required
by jsonwebtoken’s from_ed_der() methods.
Sourcepub fn encode(&self, claims: &Claims) -> Result<String, AppError>
pub fn encode(&self, claims: &Claims) -> Result<String, AppError>
Encode claims into a signed JWT access token.
Auto Trait Implementations§
impl Freeze for JwtKeys
impl RefUnwindSafe for JwtKeys
impl Send for JwtKeys
impl Sync for JwtKeys
impl Unpin for JwtKeys
impl UnsafeUnpin for JwtKeys
impl UnwindSafe for JwtKeys
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
Source§impl<T> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ResourceProvider<()> for T
impl<T> ResourceProvider<()> for T
Source§fn get_resource(&self) -> &()
fn get_resource(&self) -> &()
Returns a reference to the resource of type
T.