Skip to main content

Mountain/Binary/Build/
TlsCommands.rs

1#![allow(non_snake_case)]
2
3//! # TLS certificate management commands
4//!
5//! Tauri commands that expose the local CA + server cert cache
6//! (managed by `CertificateManager`) to the webview. Each
7//! command lives in its own sibling file; the wire-bound names
8//! match the file names.
9//!
10//! Currently registered nowhere - kept for the upcoming
11//! TLS-aware webview surface. Adding the entries to
12//! `Binary/Main/Entry.rs::invoke_handler!` is the activation
13//! step.
14
15pub mod CertificateGenerationResult;
16pub mod CertificateStatus;
17pub mod tls_check_cert_status;
18pub mod tls_delete_cert;
19pub mod tls_generate_cert;
20pub mod tls_get_all_certs;
21pub mod tls_get_ca_cert;
22pub mod tls_get_server_cert_info;
23pub mod tls_initialize;
24pub mod tls_renew_certificate;
25
26#[cfg(test)]
27mod tests {
28	use super::CertificateStatus::CertificateStatus;
29
30	#[test]
31	fn CertificateStatusSerialization() {
32		let status = CertificateStatus {
33			exists:true,
34			is_valid:true,
35			days_until_expiry:30,
36			needs_renewal:true,
37			valid_until:"2025-01-01T00:00:00Z".to_string(),
38		};
39
40		let json = serde_json::to_string(&status).unwrap();
41		let deserialized:CertificateStatus = serde_json::from_str(&json).unwrap();
42		assert_eq!(deserialized.exists, status.exists);
43	}
44}