[−][src]Trait biscuit::CompactPart
A "part" of the compact representation of JWT/JWS/JWE. Parts are first serialized to some form and then base64 encoded and separated by periods.
An automatic implementation for any T
that implements the marker trait CompactJson
is provided.
This implementation will serialize/deserialize T
to JSON via serde.
Required methods
fn to_bytes(&self) -> Result<Vec<u8>, Error>
Convert this part into bytes
fn from_bytes(bytes: &[u8]) -> Result<Self, Error> where
Self: Sized,
Self: Sized,
Convert a sequence of bytes into Self
Provided methods
fn from_base64<B: AsRef<[u8]>>(encoded: &B) -> Result<Self, Error> where
Self: Sized,
Self: Sized,
Base64 decode into Self
fn to_base64(&self) -> Result<Base64Url, Error>
Serialize Self
to some form and then base64URL Encode
Implementations on Foreign Types
impl CompactPart for Vec<u8>
[src]
fn to_bytes(&self) -> Result<Vec<u8>, Error>
[src]
fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
[src]
Convert a sequence of bytes into Self
Implementors
impl CompactPart for Base64Url
[src]
fn to_bytes(&self) -> Result<Vec<u8>, Error>
[src]
fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
[src]
Convert a sequence of bytes into Self
fn to_base64(&self) -> Result<Base64Url, Error>
[src]
fn from_base64<B: AsRef<[u8]>>(encoded: &B) -> Result<Self, Error>
[src]
impl<T> CompactPart for T where
T: CompactJson,
[src]
T: CompactJson,
fn to_bytes(&self) -> Result<Vec<u8>, Error>
[src]
JSON serialize the part and return the JSON string bytes
fn from_bytes(bytes: &[u8]) -> Result<Self, Error>
[src]
impl<T: CompactPart, H: Serialize + DeserializeOwned> CompactPart for Compact<T, H>
[src]
Implementation for embedded inside a JWE.