Struct libjwt::Jwt
[−]
[src]
pub struct Jwt<'jwt>(_);
A Simple Jwt
Methods
impl<'jwt> Jwt<'jwt>
[src]
pub fn new<S>(raw: S) -> Self where
S: Into<Cow<'jwt, str>>,
[src]
S: Into<Cow<'jwt, str>>,
Create a Jwt from any type who can be turned into a Cow<'jwt, str>
pub fn encode<K: AsKey>(
header: &Header,
payload: &Payload,
key: &K,
algorithm: Option<Algorithm>
) -> Result<Self>
[src]
header: &Header,
payload: &Payload,
key: &K,
algorithm: Option<Algorithm>
) -> Result<Self>
Encode header and payload into a valid JWT
pub fn decode<K: AsKey>(
&self,
key: &K,
algorithm: Option<Algorithm>
) -> Result<Parts>
[src]
&self,
key: &K,
algorithm: Option<Algorithm>
) -> Result<Parts>
Decode a Jwt token and check if signature is valid
Trait Implementations
impl<'jwt> Debug for Jwt<'jwt>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'jwt> Clone for Jwt<'jwt>
[src]
fn clone(&self) -> Jwt<'jwt>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'jwt> IntoParts<'jwt> for Jwt<'jwt>
[src]
type Error = Error
Error type from a convertion
fn into_parts(&'jwt self) -> Result<Parts>
[src]
Convert it!