From a1dd8692a31f816d8c9e0a6ec1f873f2fe9c1c44 Mon Sep 17 00:00:00 2001 From: "nieznany.sprawiciel" Date: Fri, 22 Mar 2024 17:11:14 +0100 Subject: [PATCH 1/2] Add schema before saving template --- cli/src/ui/certificate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/ui/certificate.rs b/cli/src/ui/certificate.rs index dda0323..b7977fa 100644 --- a/cli/src/ui/certificate.rs +++ b/cli/src/ui/certificate.rs @@ -166,7 +166,7 @@ impl DocumentEditor for CertificateEditor { subject: Some(self.subject_editor.get_subject()), validity_period: Some(self.validity_period_editor.get_validity_period()), }; - json!({ "certificate": certificate }) + json!({ "$schema": SIGNED_CERTIFICATE_SCHEMA_ID, "certificate": certificate }) } fn create_signed_document( From 23957d6550bc3429e808aefab8b793d3327fb964 Mon Sep 17 00:00:00 2001 From: "nieznany.sprawiciel" Date: Fri, 22 Mar 2024 17:25:16 +0100 Subject: [PATCH 2/2] Generate certificate as key.json and pub.json like docs state --- cli/src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/main.rs b/cli/src/main.rs index 54f625d..8b0299b 100644 --- a/cli/src/main.rs +++ b/cli/src/main.rs @@ -100,8 +100,8 @@ fn parse_timestamp(timestamp: &str) -> Result> { fn create_key_pair(key_pair_path: &Path) -> Result<()> { let key_pair = gcert::create_key_pair(); - save_json_with_extension(key_pair_path, &key_pair.public_key, "pub")?; - save_json_with_extension(key_pair_path, &key_pair.private_key, "key") + save_json_with_extension(key_pair_path, &key_pair.public_key, "pub.json")?; + save_json_with_extension(key_pair_path, &key_pair.private_key, "key.json") } fn print_fingerprint(input_file_path: &Path) -> Result<()> {