Skip to main content

Mountain/Binary/Build/
TlsCommands.rs

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