pub struct Jwe {
    pub protected: Option<JwmHeader>,
    pub unprotected: Option<JwmHeader>,
    pub recipient: Option<Recipient>,
    pub recipients: Option<Vec<Recipient>>,
    pub tag: Option<String>,
    /* private fields */
}
Expand description

JWE representation of Message with public header. Can be serialized to JSON or Compact representations and from same.

Fields

protected: Option<JwmHeader>

integrity protected header elements

unprotected: Option<JwmHeader>

header elements that are not integrity protected

recipient: Option<Recipient>

Top-level recipient data for flat JWE JSON messages. Will be ignored if recipients is not None

recipients: Option<Vec<Recipient>>

Pre-recipient data for flat JWE JSON messages. If not None, will be preferred over recipient.

tag: Option<String>

base64 encoded JWE authentication tag

Implementations

Constructor, which should be used after message is encrypted.

Constructor for creating a flat JWE JSON

Generate new random IV as String

Gets iv as byte array.

Getter for ciphered payload of JWE.

Gets alg header value from either protected or from unprotected.

Will default to None if not set in any of them.

Gets cty header value from either protected or from unprotected.

Will default to None if not set in any of them.

Gets enc header value from either protected or from unprotected.

Will default to None if not set in any of them.

Gets epk header value from either protected or from unprotected.

Will default to None if not set in any of them.

Gets jku header value from either protected or from unprotected.

Will default to None if not set in any of them.

Gets jwk header value from either protected or from unprotected.

Will default to None if not set in any of them.

Gets kid header value from either protected or from unprotected.

Will default to None if not set in any of them.

Gets skid header value from either protected or from unprotected.

Will default to None if not set in any of them.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.