Skip to main content

Module jwe

Module jwe 

Source
Expand description

Pure-Rust JWE compact serialization (RFC 7516) for the algorithms used by Webex KMS.

Supported algorithms:

  • RSA-OAEP + A256GCM (encrypt only — initial ECDH handshake)
  • A256KW + A256GCM (encrypt + decrypt — key retrieval, message decryption)
  • ECDH-ES + A256GCM (decrypt only — ECDH handshake response)
  • ECDH-ES+A256KW + A256GCM (decrypt only — ECDH handshake response variant)

Enums§

JweKey
Key types for JWE decryption.

Functions§

decrypt_a256kw_a256gcm
Decrypt a JWE compact serialization token using A256KW + A256GCM.
decrypt_dir_a256gcm
Decrypt a JWE compact serialization token using dir + A256GCM (direct key).
decrypt_ecdh_es
Decrypt a JWE compact serialization token encrypted with ECDH-ES (or ECDH-ES+A256KW).
decrypt_jwe
Generic JWE decryption that auto-detects the algorithm from the header.
decrypt_message_jwe
Decrypt a JWE message, auto-detecting “dir” vs “A256KW” from the header.
encrypt_a256kw_a256gcm
Encrypt plaintext using A256KW + A256GCM and return JWE compact serialization.
encrypt_dir_a256gcm
Encrypt plaintext using dir + A256GCM (direct encryption — key is CEK).
encrypt_rsa_oaep_a256gcm
Encrypt plaintext using RSA-OAEP + A256GCM and return JWE compact serialization.
unwrap_kms_response
Unwrap a KMS response — may be JWE (encrypted, 5 parts) or JWS (signed, 3 parts). For JWS, the payload is extracted directly (arrives over authenticated Mercury channel).