pub struct JwmHeader {
pub typ: MessageType,
pub enc: Option<String>,
pub kid: Option<String>,
pub skid: Option<String>,
pub alg: Option<String>,
pub jku: Option<String>,
pub jwk: Option<Jwk>,
pub epk: Option<Jwk>,
pub cty: Option<String>,
}Expand description
JWM Header as specified in RFC With single deviation - allows raw text JWM to support DIDComm spec
Designed to work for both JWE and JWS message types.
iv property is not explicitly listed in the registered properties on the RFC but is present
within example lists - used here as DIDComm crypto nonce sharing property.
Fields§
§typ: MessageType§enc: Option<String>§kid: Option<String>§skid: Option<String>§alg: Option<String>§jku: Option<String>§jwk: Option<Jwk>§epk: Option<Jwk>§cty: Option<String>Implementations§
Source§impl JwmHeader
impl JwmHeader
Sourcepub fn as_signed(&mut self, alg: &SignatureAlgorithm)
pub fn as_signed(&mut self, alg: &SignatureAlgorithm)
Setter of JOSE header properties to identify which signature alg used.
Modifies typ and alg headers.
Sourcepub fn as_encrypted(&mut self, alg: &CryptoAlgorithm)
pub fn as_encrypted(&mut self, alg: &CryptoAlgorithm)
Setter of JOSE header properties to identify which crypto alg and key type used.
Modifies enc, typ and alg headers.
pub fn kid(&mut self, kid: Option<String>)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for JwmHeader
impl<'de> Deserialize<'de> for JwmHeader
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for JwmHeader
impl StructuralPartialEq for JwmHeader
Auto Trait Implementations§
impl Freeze for JwmHeader
impl RefUnwindSafe for JwmHeader
impl Send for JwmHeader
impl Sync for JwmHeader
impl Unpin for JwmHeader
impl UnsafeUnpin for JwmHeader
impl UnwindSafe for JwmHeader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more