pub struct HashTokenProvider { /* private fields */ }Expand description
HashToken-based token provider for internal runtime trust.
Implementations§
Source§impl HashTokenProvider
impl HashTokenProvider
Sourcepub fn from_secret(secret: Vec<u8>) -> SecurityResult<Self>
pub fn from_secret(secret: Vec<u8>) -> SecurityResult<Self>
Creates a provider from at least 16 bytes of secret material.
Sourcepub fn with_material(
secret: Vec<u8>,
salts: Vec<Vec<u8>>,
algorithm: Algorithm,
) -> Self
pub fn with_material( secret: Vec<u8>, salts: Vec<Vec<u8>>, algorithm: Algorithm, ) -> Self
Creates a provider with explicit salts and HashToken algorithm.
Sourcepub fn with_secret(secret: Vec<u8>, salts: Vec<Vec<u8>>) -> Self
pub fn with_secret(secret: Vec<u8>, salts: Vec<Vec<u8>>) -> Self
Creates a SHA-256 provider with explicit secret and salts.
Sourcepub fn from_keyring(
keyring: FileSecretKeyring,
salts: Vec<Vec<u8>>,
) -> SecurityResult<Self>
pub fn from_keyring( keyring: FileSecretKeyring, salts: Vec<Vec<u8>>, ) -> SecurityResult<Self>
Creates a rotation-aware provider backed by a durable file keyring.
Trait Implementations§
Source§impl Clone for HashTokenProvider
impl Clone for HashTokenProvider
Source§fn clone(&self) -> HashTokenProvider
fn clone(&self) -> HashTokenProvider
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HashTokenProvider
impl Debug for HashTokenProvider
Source§impl Drop for HashTokenProvider
impl Drop for HashTokenProvider
Source§impl TokenProvider for HashTokenProvider
impl TokenProvider for HashTokenProvider
Source§fn seal(&self, payload: &[u8], claims: &TokenClaims) -> SecurityResult<Vec<u8>>
fn seal(&self, payload: &[u8], claims: &TokenClaims) -> SecurityResult<Vec<u8>>
Authenticates and encrypts payload bytes.
Source§fn open(&self, token: &[u8], claims: &TokenClaims) -> SecurityResult<Vec<u8>>
fn open(&self, token: &[u8], claims: &TokenClaims) -> SecurityResult<Vec<u8>>
Authenticates and decrypts token bytes.
Source§fn sign(&self, payload: &[u8], claims: &TokenClaims) -> SecurityResult<Vec<u8>>
fn sign(&self, payload: &[u8], claims: &TokenClaims) -> SecurityResult<Vec<u8>>
Produces an authenticated signature carrying payload bytes.
Source§fn verify(
&self,
payload: &[u8],
signature: &[u8],
claims: &TokenClaims,
) -> SecurityResult<()>
fn verify( &self, payload: &[u8], signature: &[u8], claims: &TokenClaims, ) -> SecurityResult<()>
Verifies that a signature carries the expected payload and claims.
Auto Trait Implementations§
impl Freeze for HashTokenProvider
impl RefUnwindSafe for HashTokenProvider
impl Send for HashTokenProvider
impl Sync for HashTokenProvider
impl Unpin for HashTokenProvider
impl UnsafeUnpin for HashTokenProvider
impl UnwindSafe for HashTokenProvider
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