@@ -34,53 +34,53 @@ pub struct ArcSealer<T: SigningKey<Hasher = Sha256>, State = NeedDomain> {
34
34
35
35
#[ derive( Debug , PartialEq , Eq , Clone , Default ) ]
36
36
pub struct Signature {
37
- pub ( crate ) i : u32 ,
38
- pub ( crate ) a : Algorithm ,
39
- pub ( crate ) d : String ,
40
- pub ( crate ) s : String ,
41
- pub ( crate ) b : Vec < u8 > ,
42
- pub ( crate ) bh : Vec < u8 > ,
43
- pub ( crate ) h : Vec < String > ,
44
- pub ( crate ) z : Vec < String > ,
45
- pub ( crate ) l : u64 ,
46
- pub ( crate ) x : u64 ,
47
- pub ( crate ) t : u64 ,
48
- pub ( crate ) ch : Canonicalization ,
49
- pub ( crate ) cb : Canonicalization ,
37
+ pub i : u32 ,
38
+ pub a : Algorithm ,
39
+ pub d : String ,
40
+ pub s : String ,
41
+ pub b : Vec < u8 > ,
42
+ pub bh : Vec < u8 > ,
43
+ pub h : Vec < String > ,
44
+ pub z : Vec < String > ,
45
+ pub l : u64 ,
46
+ pub x : u64 ,
47
+ pub t : u64 ,
48
+ pub ch : Canonicalization ,
49
+ pub cb : Canonicalization ,
50
50
}
51
51
52
52
#[ derive( Debug , PartialEq , Eq , Clone , Default ) ]
53
53
pub struct Seal {
54
- pub ( crate ) i : u32 ,
55
- pub ( crate ) a : Algorithm ,
56
- pub ( crate ) b : Vec < u8 > ,
57
- pub ( crate ) d : String ,
58
- pub ( crate ) s : String ,
59
- pub ( crate ) t : u64 ,
60
- pub ( crate ) cv : ChainValidation ,
54
+ pub i : u32 ,
55
+ pub a : Algorithm ,
56
+ pub b : Vec < u8 > ,
57
+ pub d : String ,
58
+ pub s : String ,
59
+ pub t : u64 ,
60
+ pub cv : ChainValidation ,
61
61
}
62
62
63
63
#[ derive( Debug , PartialEq , Eq , Clone ) ]
64
64
pub struct Results {
65
- pub ( crate ) i : u32 ,
65
+ pub i : u32 ,
66
66
}
67
67
68
68
#[ derive( Debug , Clone , PartialEq , Eq ) ]
69
69
pub struct ArcSet < ' x > {
70
- pub ( crate ) signature : Signature ,
71
- pub ( crate ) seal : Seal ,
72
- pub ( crate ) results : & ' x AuthenticationResults < ' x > ,
70
+ pub signature : Signature ,
71
+ pub seal : Seal ,
72
+ pub results : & ' x AuthenticationResults < ' x > ,
73
73
}
74
74
75
75
#[ derive( Debug , Clone , PartialEq , Eq ) ]
76
76
pub struct Set < ' x > {
77
- pub ( crate ) signature : Header < ' x , & ' x Signature > ,
78
- pub ( crate ) seal : Header < ' x , & ' x Seal > ,
79
- pub ( crate ) results : Header < ' x , & ' x Results > ,
77
+ pub signature : Header < ' x , & ' x Signature > ,
78
+ pub seal : Header < ' x , & ' x Seal > ,
79
+ pub results : Header < ' x , & ' x Results > ,
80
80
}
81
81
82
82
#[ derive( Debug , PartialEq , Eq , Clone , Default ) ]
83
- pub ( crate ) enum ChainValidation {
83
+ pub enum ChainValidation {
84
84
#[ default]
85
85
None ,
86
86
Fail ,
@@ -123,12 +123,17 @@ impl VerifySignature for Seal {
123
123
}
124
124
}
125
125
126
- impl ArcOutput < ' _ > {
127
- pub ( crate ) fn with_result ( mut self , result : DkimResult ) -> Self {
126
+ impl < ' x > ArcOutput < ' x > {
127
+ pub fn with_result ( mut self , result : DkimResult ) -> Self {
128
128
self . result = result;
129
129
self
130
130
}
131
131
132
+ pub fn with_set ( mut self , set : Set < ' x > ) -> Self {
133
+ self . set . push ( set) ;
134
+ self
135
+ }
136
+
132
137
pub fn can_be_sealed ( & self ) -> bool {
133
138
self . set . is_empty ( ) || self . set . last ( ) . unwrap ( ) . seal . header . cv != ChainValidation :: Fail
134
139
}
0 commit comments