-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Didier Wenzek <[email protected]>
- Loading branch information
1 parent
2ee837c
commit fba8ed6
Showing
3 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
mod upload; | ||
mod download; | ||
mod renew; | ||
|
||
pub use upload::UploadCertCmd; | ||
pub use download::DownloadCertCmd; | ||
pub use renew::RenewCertCmd; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
use crate::command::Command; | ||
use crate::log::MaybeFancy; | ||
use anyhow::Error; | ||
use camino::Utf8PathBuf; | ||
use certificate::CloudRootCerts; | ||
use tedge_config::HostPort; | ||
use tedge_config::HTTPS_PORT; | ||
use tedge_config::MQTT_TLS_PORT; | ||
|
||
/// Command to renew a device certificate from Cumulocity | ||
pub struct RenewCertCmd { | ||
/// The device identifier to be used as the common name for the certificate | ||
pub device_id: String, | ||
|
||
/// Cumulocity MQTT end-point where the device is authenticated | ||
pub c8y_mqtt: HostPort<MQTT_TLS_PORT>, | ||
|
||
/// Cumulocity instance from where the device got his current certificate | ||
pub c8y_url: HostPort<HTTPS_PORT>, | ||
|
||
/// Root certificates used to authenticate the Cumulocity instance | ||
pub root_certs: CloudRootCerts, | ||
|
||
/// The path where the device certificate will be stored | ||
pub cert_path: Utf8PathBuf, | ||
|
||
/// The path where the device private key will be stored | ||
pub key_path: Utf8PathBuf, | ||
|
||
/// The path where the device CSR file will be stored | ||
pub csr_path: Utf8PathBuf, | ||
} | ||
|
||
impl Command for RenewCertCmd { | ||
fn description(&self) -> String { | ||
format!("Renew the device certificate from {}", self.c8y_url) | ||
} | ||
|
||
fn execute(&self) -> Result<(), MaybeFancy<Error>> { | ||
todo!() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters