pub struct Signature {
pub protected: Option<JwmHeader>,
pub header: Option<JwmHeader>,
pub signature: Vec<u8>,
}Expand description
Signature data for JWS envelopes.
They can be used per recipient in General JWS JSON,
triggered by using .as_jws or as a single signature for the entire JWS in
Flattened JWS JSON, triggered by
.as_flat_jws.
Fields§
§protected: Option<JwmHeader>integrity protected header elements
header: Option<JwmHeader>header elements that are not integrity protected
signature: Vec<u8>signature computed over protected header elements
Implementations§
Source§impl Signature
impl Signature
Sourcepub fn new(
protected: Option<JwmHeader>,
header: Option<JwmHeader>,
signature: Vec<u8>,
) -> Self
pub fn new( protected: Option<JwmHeader>, header: Option<JwmHeader>, signature: Vec<u8>, ) -> Self
Creates a new Signature that can be used in JWS signatures property or
as top-level (flattened) property in flattened JWS JSON serialization.
§Arguments
-
protected- JWM header protected by signing -
header- JWM header not protected by signing -
signature- signature over JWS payload and protected header
Sourcepub fn get_alg(&self) -> Option<String>
pub fn get_alg(&self) -> Option<String>
Gets alg header value from either header or from protected.
Will default to None if not set in any of them.
Sourcepub fn get_cty(&self) -> Option<String>
pub fn get_cty(&self) -> Option<String>
Gets cty header value from either header or from protected.
Will default to None if not set in any of them.
Sourcepub fn get_enc(&self) -> Option<String>
pub fn get_enc(&self) -> Option<String>
Gets enc header value from either header or from protected.
Will default to None if not set in any of them.
Sourcepub fn get_epk(&self) -> Option<Jwk>
pub fn get_epk(&self) -> Option<Jwk>
Gets epk header value from either header or from protected.
Will default to None if not set in any of them.
Sourcepub fn get_jku(&self) -> Option<String>
pub fn get_jku(&self) -> Option<String>
Gets jku header value from either header or from protected.
Will default to None if not set in any of them.
Sourcepub fn get_jwk(&self) -> Option<Jwk>
pub fn get_jwk(&self) -> Option<Jwk>
Gets jwk header value from either header or from protected.
Will default to None if not set in any of them.