Motion Master 6.0.0-alpha.50
Next-generation motion control software
Loading...
Searching...
No Matches
cert_info.h
Go to the documentation of this file.
1#pragma once
2
3#include <chrono>
4#include <expected>
5#include <string>
6#include <vector>
7
8namespace mm {
9
15inline constexpr int kCertExpiringSoonDays = 7;
16
21 std::string subject;
22 std::string issuer;
23 std::string organization;
24 std::string issuerOrganization;
25};
26
28struct CertInfo {
29 std::string subject;
30 std::string issuer;
31 std::chrono::system_clock::time_point notBefore;
32 std::chrono::system_clock::time_point notAfter;
36 std::vector<CertChainLink> chain;
37};
38
46std::expected<CertInfo, std::string> readCertInfo(const std::string& certPath);
47
48} // namespace mm
Definition cert_info.cc:13
std::expected< CertInfo, std::string > readCertInfo(const std::string &certPath)
Parses a PEM file and extracts the leaf's validity window and the full certificate chain.
Definition cert_info.cc:64
constexpr int kCertExpiringSoonDays
Number of days before notAfter at which a certificate is considered "expiring soon"....
Definition cert_info.h:15
Validity window and identity of a TLS leaf certificate, plus the full served chain.
Definition cert_info.h:28
std::chrono::system_clock::time_point notAfter
Definition cert_info.h:32
std::vector< CertChainLink > chain
Definition cert_info.h:36
std::string subject
Leaf subject common name (CN), e.g. "local.motion-master...".
Definition cert_info.h:29
std::chrono::system_clock::time_point notBefore
Start of the leaf's validity window.
Definition cert_info.h:31
std::string issuer
Leaf issuer common name (CN) — the immediate (intermediate) CA.
Definition cert_info.h:30