File tree Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Expand file tree Collapse file tree 2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change @@ -7,20 +7,27 @@ Catalyst signed document crate implementation based on this
77
88## Example
99
10- Generate a ` ed25519 ` private and public keys
10+ ### Generate a ` ed25519 ` private and public keys
1111
1212``` shell
1313openssl genpkey -algorithm=ED25519 -out=private.pem -outpubkey=public.pem
1414```
1515
16- Prepare non-signed document,
16+ ### Prepare non-signed document,
1717` meta.json ` file should follow the [ ` meta.schema.json ` ] ( ./meta.schema.json ) .
1818
1919``` shell
2020cargo run -p catalyst-signed-doc --example mk_signed_doc build signed_doc/doc.json signed_doc/doc.cose signed_doc/meta.json
2121```
2222
23- Inspect document
23+ ### Sign document
24+ ` KID ` is a valid Catalyst ID URI.
25+
26+ ``` shell
27+ cargo run -p catalyst-signed-doc --example mk_signed_doc sign signed_doc/doc.cose signed_doc/meta.json < KID>
28+ ```
29+
30+ ### Inspect document
2431
2532``` shell
2633cargo run -p catalyst-signed-doc --example mk_signed_doc inspect signed_doc/doc.cose
Original file line number Diff line number Diff line change @@ -107,6 +107,23 @@ impl CatalystSignedDocument {
107107 & self . inner . signatures
108108 }
109109
110+ /// Return a list of Document's Catalyst IDs.
111+ #[ must_use]
112+ pub fn kids ( & self ) -> Vec < IdUri > {
113+ self . inner . signatures . kids ( )
114+ }
115+
116+ /// Return a list of Document's author IDs (short form of Catalyst IDs).
117+ #[ must_use]
118+ pub fn authors ( & self ) -> Vec < IdUri > {
119+ self . inner
120+ . signatures
121+ . kids ( )
122+ . into_iter ( )
123+ . map ( |k| k. as_short_id ( ) )
124+ . collect ( )
125+ }
126+
110127 /// Verify document signatures.
111128 ///
112129 /// # Errors
You can’t perform that action at this time.
0 commit comments