@@ -175,44 +175,43 @@ impl CatalystSignedDocument {
175175 /// Return Document Type `UUIDv4`.
176176 #[ must_use]
177177 pub fn doc_type ( & self ) -> uuid:: Uuid {
178- self . inner . metadata . r#type
178+ self . inner . metadata . doc_type ( )
179179 }
180180
181181 /// Return Document ID `UUIDv7`.
182182 #[ must_use]
183183 pub fn doc_id ( & self ) -> uuid:: Uuid {
184- self . inner . metadata . id
184+ self . inner . metadata . doc_id ( )
185185 }
186186
187187 /// Return Document Version `UUIDv7`.
188188 #[ must_use]
189189 pub fn doc_ver ( & self ) -> uuid:: Uuid {
190- self . inner . metadata . ver
190+ self . inner . metadata . doc_ver ( )
191191 }
192192
193193 /// Return Last Document Reference `Option<DocumentRef>`.
194194 #[ must_use]
195195 pub fn doc_ref ( & self ) -> Option < DocumentRef > {
196- self . inner . metadata . r#ref
196+ self . inner . metadata . doc_ref ( )
197197 }
198198
199199 /// Return Document Template `Option<DocumentRef>`.
200200 #[ must_use]
201201 pub fn doc_template ( & self ) -> Option < DocumentRef > {
202- self . inner . metadata . template
202+ self . inner . metadata . doc_template ( )
203203 }
204204
205205 /// Return Document Reply `Option<DocumentRef>`.
206206 #[ must_use]
207207 pub fn doc_reply ( & self ) -> Option < DocumentRef > {
208- self . inner . metadata . reply
208+ self . inner . metadata . doc_reply ( )
209209 }
210210}
211211
212212/// Generate the COSE protected header used by Catalyst Signed Document.
213213fn cose_protected_header ( ) -> coset:: Header {
214214 coset:: HeaderBuilder :: new ( )
215- . algorithm ( coset:: iana:: Algorithm :: EdDSA )
216215 . content_format ( coset:: iana:: CoapContentFormat :: Json )
217216 . text_value (
218217 CONTENT_ENCODING_KEY . to_string ( ) ,
@@ -267,10 +266,6 @@ fn metadata_from_cose_protected_header(cose: &coset::CoseSign) -> (Metadata, Con
267266 let expected_header = cose_protected_header ( ) ;
268267 let mut errors = Vec :: new ( ) ;
269268
270- if cose. protected . header . alg != expected_header. alg {
271- errors. push ( "Invalid COSE document protected header `algorithm` field" . to_string ( ) ) ;
272- }
273-
274269 if cose. protected . header . content_type != expected_header. content_type {
275270 errors. push ( "Invalid COSE document protected header `content-type` field" . to_string ( ) ) ;
276271 }
0 commit comments