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