1use crate::dkim::types::{Algorithm, CanonicalizationMethod};
2
3#[derive(Debug, Clone)]
5pub struct ArcSet {
6 pub instance: u32,
7 pub aar: ArcAuthenticationResults,
8 pub ams: ArcMessageSignature,
9 pub seal: ArcSeal,
10}
11
12#[derive(Debug, Clone)]
14pub struct ArcAuthenticationResults {
15 pub instance: u32,
16 pub payload: String,
17 pub raw_header: String,
18}
19
20#[derive(Debug, Clone)]
22pub struct ArcMessageSignature {
23 pub instance: u32,
24 pub algorithm: Algorithm,
25 pub signature: Vec<u8>,
26 pub body_hash: Vec<u8>,
27 pub domain: String,
28 pub selector: String,
29 pub signed_headers: Vec<String>,
30 pub header_canonicalization: CanonicalizationMethod,
31 pub body_canonicalization: CanonicalizationMethod,
32 pub timestamp: Option<u64>,
33 pub body_length: Option<u64>,
34 pub raw_header: String,
35}
36
37#[derive(Debug, Clone)]
39pub struct ArcSeal {
40 pub instance: u32,
41 pub cv: ChainValidationStatus,
42 pub algorithm: Algorithm,
43 pub signature: Vec<u8>,
44 pub domain: String,
45 pub selector: String,
46 pub timestamp: Option<u64>,
47 pub raw_header: String,
48}
49
50#[derive(Debug, Clone, Copy, PartialEq, Eq)]
52pub enum ChainValidationStatus {
53 None,
54 Pass,
55 Fail,
56}
57
58#[derive(Debug, Clone, PartialEq, Eq)]
60pub enum ArcResult {
61 None,
62 Pass,
63 Fail { reason: String },
64}
65
66#[derive(Debug, Clone)]
68pub struct ArcValidationResult {
69 pub status: ArcResult,
70 pub oldest_pass: Option<u32>,
72}