[][src]Struct picky::jose::jws::Jws

pub struct Jws {
    pub header: JwsHeader,
    pub payload: Vec<u8>,
}

Provides an API to sign any kind of data (binary). JSON claims are part of Jwt only.

Fields

header: JwsHeaderpayload: Vec<u8>

Implementations

impl Jws[src]

pub fn new(alg: JwsAlg, payload: Vec<u8>) -> Self[src]

pub fn check_signature(
    &self,
    encoded_token: &str,
    public_key: &PublicKey
) -> Result<(), JwsError>
[src]

pub fn encode(&self, private_key: &PrivateKey) -> Result<String, JwsError>[src]

pub fn decode(
    encoded_token: &str,
    public_key: &PublicKey
) -> Result<Self, JwsError>
[src]

Validate using validator and returns decoded JWS payload.

pub fn decode_without_validation(encoded_token: &str) -> Result<Self, JwsError>[src]

Unsafe JWS decoding method. Signature isn't checked at all.

Trait Implementations

impl Clone for Jws[src]

impl Debug for Jws[src]

Auto Trait Implementations

impl RefUnwindSafe for Jws

impl Send for Jws

impl Sync for Jws

impl Unpin for Jws

impl UnwindSafe for Jws

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,