pub struct LocalToken;Available on crate feature
v2 only.Expand description
PASETO v2 local tokens.
Implementations§
Source§impl LocalToken
impl LocalToken
Sourcepub const HEADER: &'static str = "v2.local."
pub const HEADER: &'static str = "v2.local."
The header and purpose for the local token: v2.local..
Sourcepub fn encrypt(
secret_key: &SymmetricKey<V2>,
message: &[u8],
footer: Option<&[u8]>,
) -> Result<String, Error>
pub fn encrypt( secret_key: &SymmetricKey<V2>, message: &[u8], footer: Option<&[u8]>, ) -> Result<String, Error>
Create a local token.
Sourcepub fn decrypt(
secret_key: &SymmetricKey<V2>,
token: &UntrustedToken<Local, V2>,
footer: Option<&[u8]>,
) -> Result<TrustedToken, Error>
pub fn decrypt( secret_key: &SymmetricKey<V2>, token: &UntrustedToken<Local, V2>, footer: Option<&[u8]>, ) -> Result<TrustedToken, Error>
Verify and decrypt a local token.
If footer.is_none(), then it will be validated but not compared to a known value.
If footer.is_some(), then it will be validated AND compared to the known value.
Auto Trait Implementations§
impl Freeze for LocalToken
impl RefUnwindSafe for LocalToken
impl Send for LocalToken
impl Sync for LocalToken
impl Unpin for LocalToken
impl UnsafeUnpin for LocalToken
impl UnwindSafe for LocalToken
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