@@ -112,7 +112,7 @@ impl CatalystSignedDocument {
112112 /// # Errors
113113 ///
114114 /// Returns a report of verification failures and the source error.
115- #[ allow( clippy:: indexing_slicing) ]
115+ #[ allow( clippy:: indexing_slicing, clippy :: too_many_lines ) ]
116116 pub fn verify < P > ( & self , pk_getter : P ) -> Result < ( ) , CatalystSignedDocError >
117117 where P : Fn ( & KidUri ) -> VerifyingKey {
118118 let error_report = ProblemReport :: new ( "Catalyst Signed Document Verification" ) ;
@@ -147,6 +147,70 @@ impl CatalystSignedDocument {
147147 ) ;
148148 }
149149
150+ let extra = self . doc_meta ( ) ;
151+ if let Some ( doc_ref) = extra. doc_ref ( ) {
152+ if !doc_ref. is_valid ( ) {
153+ error_report. functional_validation (
154+ & format ! ( "Document Reference {doc_ref:?} is invalid" ) ,
155+ "During Document Reference UUID verification" ,
156+ ) ;
157+ }
158+ }
159+
160+ if let Some ( template) = extra. template ( ) {
161+ if !template. is_valid ( ) {
162+ error_report. functional_validation (
163+ & format ! ( "Document Template {template:?} is invalid" ) ,
164+ "During Document Template UUID verification" ,
165+ ) ;
166+ }
167+ }
168+
169+ if let Some ( reply) = extra. reply ( ) {
170+ if !reply. is_valid ( ) {
171+ error_report. functional_validation (
172+ & format ! ( "Document Reply {reply:?} is invalid" ) ,
173+ "During Document Reply UUID verification" ,
174+ ) ;
175+ }
176+ }
177+
178+ if let Some ( brand_id) = extra. brand_id ( ) {
179+ if !brand_id. is_valid ( ) {
180+ error_report. functional_validation (
181+ & format ! ( "Document Brand ID {brand_id:?} is invalid" ) ,
182+ "During Document Brand ID UUID verification" ,
183+ ) ;
184+ }
185+ }
186+
187+ if let Some ( campaign_id) = extra. campaign_id ( ) {
188+ if !campaign_id. is_valid ( ) {
189+ error_report. functional_validation (
190+ & format ! ( "Document Campaign ID {campaign_id:?} is invalid" ) ,
191+ "During Document Campaign ID UUID verification" ,
192+ ) ;
193+ }
194+ }
195+
196+ if let Some ( election_id) = extra. election_id ( ) {
197+ if !election_id. is_valid ( ) {
198+ error_report. functional_validation (
199+ & format ! ( "Document Election ID {election_id:?} is invalid" ) ,
200+ "During Document Election ID UUID verification" ,
201+ ) ;
202+ }
203+ }
204+
205+ if let Some ( category_id) = extra. category_id ( ) {
206+ if !category_id. is_valid ( ) {
207+ error_report. functional_validation (
208+ & format ! ( "Document Category ID {category_id:?} is invalid" ) ,
209+ "During Document Category ID UUID verification" ,
210+ ) ;
211+ }
212+ }
213+
150214 match self . as_cose_sign ( ) {
151215 Ok ( cose_sign) => {
152216 let signatures = self . signatures ( ) . cose_signatures ( ) ;
0 commit comments