Struct identity_iota::storage::JwsSignatureOptions
source · #[non_exhaustive]pub struct JwsSignatureOptions {
pub attach_jwk: bool,
pub b64: Option<bool>,
pub typ: Option<String>,
pub cty: Option<String>,
pub url: Option<Url>,
pub nonce: Option<String>,
pub kid: Option<String>,
pub detached_payload: bool,
pub custom_header_parameters: Option<BTreeMap<String, Value>>,
}
Expand description
Options for creating a JSON Web Signature.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.attach_jwk: bool
Whether to attach the public key in the corresponding method to the JWS header.
b64: Option<bool>
Whether to Base64url encode the payload or not.
typ: Option<String>
The Type value to be placed in the protected header.
cty: Option<String>
Content Type to be placed in the protected header.
url: Option<Url>
The URL to be placed in the protected header.
nonce: Option<String>
The nonce to be placed in the protected header.
kid: Option<String>
The kid to set in the protected header.
If unset, the kid of the JWK with which the JWS is produced is used.
detached_payload: bool
Whether the payload should be detached from the JWS.
custom_header_parameters: Option<BTreeMap<String, Value>>
Additional header parameters.
Implementations§
source§impl JwsSignatureOptions
impl JwsSignatureOptions
sourcepub fn new() -> JwsSignatureOptions
pub fn new() -> JwsSignatureOptions
Creates a new JwsSignatureOptions
.
sourcepub fn attach_jwk_to_header(self, value: bool) -> JwsSignatureOptions
pub fn attach_jwk_to_header(self, value: bool) -> JwsSignatureOptions
Replace the value of the attach_jwk
field.
sourcepub fn b64(self, value: bool) -> JwsSignatureOptions
pub fn b64(self, value: bool) -> JwsSignatureOptions
Replace the value of the b64
field.
sourcepub fn typ(self, value: impl Into<String>) -> JwsSignatureOptions
pub fn typ(self, value: impl Into<String>) -> JwsSignatureOptions
Replace the value of the typ
field.
sourcepub fn cty(self, value: impl Into<String>) -> JwsSignatureOptions
pub fn cty(self, value: impl Into<String>) -> JwsSignatureOptions
Replace the value of the cty
field.
sourcepub fn url(self, value: Url) -> JwsSignatureOptions
pub fn url(self, value: Url) -> JwsSignatureOptions
Replace the value of the url
field.
sourcepub fn nonce(self, value: impl Into<String>) -> JwsSignatureOptions
pub fn nonce(self, value: impl Into<String>) -> JwsSignatureOptions
Replace the value of the nonce
field.
sourcepub fn kid(self, value: impl Into<String>) -> JwsSignatureOptions
pub fn kid(self, value: impl Into<String>) -> JwsSignatureOptions
Replace the value of the kid
field.
sourcepub fn detached_payload(self, value: bool) -> JwsSignatureOptions
pub fn detached_payload(self, value: bool) -> JwsSignatureOptions
Replace the value of the detached_payload
field.
sourcepub fn custom_header_parameters(
self,
value: BTreeMap<String, Value>
) -> JwsSignatureOptions
pub fn custom_header_parameters( self, value: BTreeMap<String, Value> ) -> JwsSignatureOptions
Adds additional header parameters.
Trait Implementations§
source§impl Clone for JwsSignatureOptions
impl Clone for JwsSignatureOptions
source§fn clone(&self) -> JwsSignatureOptions
fn clone(&self) -> JwsSignatureOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for JwsSignatureOptions
impl Debug for JwsSignatureOptions
source§impl Default for JwsSignatureOptions
impl Default for JwsSignatureOptions
source§fn default() -> JwsSignatureOptions
fn default() -> JwsSignatureOptions
source§impl<'de> Deserialize<'de> for JwsSignatureOptionswhere
JwsSignatureOptions: Default,
impl<'de> Deserialize<'de> for JwsSignatureOptionswhere
JwsSignatureOptions: Default,
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<JwsSignatureOptions, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<JwsSignatureOptions, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for JwsSignatureOptions
impl PartialEq for JwsSignatureOptions
source§fn eq(&self, other: &JwsSignatureOptions) -> bool
fn eq(&self, other: &JwsSignatureOptions) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for JwsSignatureOptions
impl Serialize for JwsSignatureOptions
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for JwsSignatureOptions
impl StructuralPartialEq for JwsSignatureOptions
Auto Trait Implementations§
impl Freeze for JwsSignatureOptions
impl RefUnwindSafe for JwsSignatureOptions
impl Send for JwsSignatureOptions
impl Sync for JwsSignatureOptions
impl Unpin for JwsSignatureOptions
impl UnwindSafe for JwsSignatureOptions
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> FromJson for Twhere
T: for<'de> Deserialize<'de>,
impl<T> FromJson for Twhere
T: for<'de> Deserialize<'de>,
source§fn from_json(json: &(impl AsRef<str> + ?Sized)) -> Result<Self, Error>
fn from_json(json: &(impl AsRef<str> + ?Sized)) -> Result<Self, Error>
Self
from a string of JSON text.source§fn from_json_slice(json: &(impl AsRef<[u8]> + ?Sized)) -> Result<Self, Error>
fn from_json_slice(json: &(impl AsRef<[u8]> + ?Sized)) -> Result<Self, Error>
Self
from bytes of JSON text.source§fn from_json_value(json: Value) -> Result<Self, Error>
fn from_json_value(json: Value) -> Result<Self, Error>
Self
from a serde_json::Value
.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> ToJson for Twhere
T: Serialize,
impl<T> ToJson for Twhere
T: Serialize,
source§fn to_json_value(&self) -> Result<Value, Error>
fn to_json_value(&self) -> Result<Value, Error>
self
as a serde_json::Value
.