Trait josekit::jwe::JweEncrypter[][src]

pub trait JweEncrypter: Debug + Send + Sync {
    fn algorithm(&self) -> &dyn JweAlgorithm;
fn key_id(&self) -> Option<&str>;
fn compute_content_encryption_key(
        &self,
        cencryption: &dyn JweContentEncryption,
        in_header: &JweHeader,
        out_header: &mut JweHeader
    ) -> Result<Option<Cow<'_, [u8]>>, JoseError>;
fn encrypt(
        &self,
        key: &[u8],
        in_header: &JweHeader,
        out_header: &mut JweHeader
    ) -> Result<Option<Vec<u8>>, JoseError>;
fn box_clone(&self) -> Box<dyn JweEncrypter>; }

Required methods

Return the source algorithm instance.

Return the source key ID. The default value is a value of kid parameter in JWK.

Compute a content encryption key.

Arguments
  • cencryption - The content encryption method.
  • in_header - the input header
  • out_header - the output header

Return a encypted key.

Arguments
  • key - The content encryption key
  • in_header - the input header
  • out_header - the output header

Implementors