Trait ssi_claims::JwsPayload

source ·
pub trait JwsPayload {
    // Required method
    fn payload_bytes(&self) -> Cow<'_, [u8]>;

    // Provided methods
    fn typ(&self) -> Option<&str> { ... }
    fn cty(&self) -> Option<&str> { ... }
    async fn sign(
        &self,
        signer: impl JwsSigner,
    ) -> Result<JwsBuf, SignatureError> { ... }
}
Expand description

JWS payload type.

Any type that can be serialized with a give JWS type.

Required Methods§

source

fn payload_bytes(&self) -> Cow<'_, [u8]>

Provided Methods§

source

fn typ(&self) -> Option<&str>

JWS type.

Value of the typ field in the JWS header.

source

fn cty(&self) -> Option<&str>

JWS cty header value.

source

async fn sign(&self, signer: impl JwsSigner) -> Result<JwsBuf, SignatureError>

Signs the payload and returns a compact JWS.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl JwsPayload for Value

source§

fn payload_bytes(&self) -> Cow<'_, [u8]>

source§

impl JwsPayload for str

source§

fn payload_bytes(&self) -> Cow<'_, [u8]>

source§

impl JwsPayload for String

source§

fn payload_bytes(&self) -> Cow<'_, [u8]>

source§

impl JwsPayload for Vec<u8>

source§

fn payload_bytes(&self) -> Cow<'_, [u8]>

source§

impl JwsPayload for RegisteredClaims

source§

fn typ(&self) -> Option<&'static str>

source§

fn payload_bytes(&self) -> Cow<'_, [u8]>

source§

impl JwsPayload for SdJwtPayload

source§

fn payload_bytes(&self) -> Cow<'_, [u8]>

source§

impl JwsPayload for [u8]

source§

fn payload_bytes(&self) -> Cow<'_, [u8]>

source§

impl<'a, P> JwsPayload for &'a P
where P: JwsPayload + ?Sized,

source§

fn typ(&self) -> Option<&str>

source§

fn cty(&self) -> Option<&str>

source§

fn payload_bytes(&self) -> Cow<'_, [u8]>

source§

async fn sign(&self, signer: impl JwsSigner) -> Result<JwsBuf, SignatureError>

source§

impl<T> JwsPayload for JoseVc<T>
where T: Serialize,

source§

fn typ(&self) -> Option<&str>

source§

fn cty(&self) -> Option<&str>

source§

fn payload_bytes(&self) -> Cow<'_, [u8]>

source§

impl<T> JwsPayload for JoseVp<T>
where T: Serialize,

source§

fn typ(&self) -> Option<&str>

source§

fn cty(&self) -> Option<&str>

source§

fn payload_bytes(&self) -> Cow<'_, [u8]>

Implementors§

source§

impl<T> JwsPayload for JWTClaims<T>
where T: Serialize,