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;
16
17pub mod CertificateStatus;
18
19pub mod tls_check_cert_status;
20
21pub mod tls_delete_cert;
22
23pub mod tls_generate_cert;
24
25pub mod tls_get_all_certs;
26
27pub mod tls_get_ca_cert;
28
29pub mod tls_get_server_cert_info;
30
31pub mod tls_initialize;
32
33pub mod tls_renew_certificate;
34
35#[cfg(test)]
36mod tests {
37
38 use super::CertificateStatus::CertificateStatus;
39
40 #[test]
41 fn CertificateStatusSerialization() {
42 let status = CertificateStatus {
43 exists:true,
44
45 is_valid:true,
46
47 days_until_expiry:30,
48
49 needs_renewal:true,
50
51 valid_until:"2025-01-01T00:00:00Z".to_string(),
52 };
53
54 let json = serde_json::to_string(&status).unwrap();
55
56 let deserialized:CertificateStatus = serde_json::from_str(&json).unwrap();
57
58 assert_eq!(deserialized.exists, status.exists);
59 }
60}