tap_agent/message.rs
1//! Message types and utilities for the TAP Agent.
2//!
3//! This module provides constants and types for working with TAP messages,
4//! including security modes and message type identifiers.
5
6/// Security mode for message packing and unpacking.
7///
8/// Defines the level of protection applied to messages:
9/// - `Plain`: No encryption or signing (insecure, only for testing)
10/// - `Signed`: Message is signed but not encrypted (integrity protected)
11/// - `AuthCrypt`: Message is authenticated and encrypted (confidentiality + integrity)
12/// - `Any`: Accept any security mode when unpacking (only used for receiving)
13#[derive(Debug, Clone, Copy)]
14pub enum SecurityMode {
15 /// Plaintext - no encryption or signatures
16 Plain,
17 /// Signed - message is signed but not encrypted
18 Signed,
19 /// Authenticated and Encrypted - message is both signed and encrypted
20 AuthCrypt,
21 /// Any security mode - used for unpacking when any mode is acceptable
22 Any,
23}
24
25/// Message type identifiers used by the TAP Protocol
26/// These constant strings are used to identify different message types
27/// in the TAP protocol communications.
28/// Type identifier for Presentation messages
29pub const PRESENTATION_MESSAGE_TYPE: &str = "https://tap.rsvp/schema/1.0#Presentation";