Skip to content

Commit

Permalink
fixup! Fully untangle certificate request, creation and renewal
Browse files Browse the repository at this point in the history
  • Loading branch information
didier-wenzek committed Nov 27, 2024
1 parent 950ebcb commit 4cf7c88
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/core/tedge/src/cli/certificate/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ use std::path::Path;
use tedge_utils::paths::set_permission;
use tedge_utils::paths::validate_parent_dir_exists;

/// Create self-signed device certificate and signing request
/// Create self-signed device certificate
pub struct CreateCertCmd {
/// The device identifier
pub id: String,

/// The path where the device certificate / request will be stored
/// The path where the device certificate will be stored
pub cert_path: Utf8PathBuf,

/// The path where the device private key will be stored
Expand Down
8 changes: 8 additions & 0 deletions crates/core/tedge/src/cli/certificate/create_csr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,19 @@ use certificate::KeyCertPair;
use certificate::KeyKind;
use certificate::NewCertificateConfig;

/// Create a certificate signing request (CSR)
pub struct CreateCsrCmd {
/// The device identifier (either explicitly given or extracted from a previous certificate)
pub id: Option<String>,
pub cert_path: Utf8PathBuf,

/// The path where the device private key will be stored
pub key_path: Utf8PathBuf,

/// The path where the device CSR will be stored
pub csr_path: Utf8PathBuf,

/// The owner of the private key
pub user: String,
pub group: String,
}
Expand Down
4 changes: 4 additions & 0 deletions crates/core/tedge/src/cli/certificate/renew.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ use camino::Utf8PathBuf;
use certificate::KeyCertPair;
use certificate::NewCertificateConfig;

/// Renew the self-signed device certificate
pub struct RenewCertCmd {
/// The path of the certificate to be updated
pub cert_path: Utf8PathBuf,

/// The path of the private key to re-use
pub key_path: Utf8PathBuf,
}

Expand Down

0 comments on commit 4cf7c88

Please sign in to comment.