MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / add_san

Function add_san

crates/openshell-bootstrap/src/pki.rs:145–151  ·  view source on GitHub ↗

Add a SAN, automatically choosing `IpAddress` or `DnsName` based on the value.

(sans: &mut Vec<SanType>, value: &str)

Source from the content-addressed store, hash-verified

143
144/// Add a SAN, automatically choosing `IpAddress` or `DnsName` based on the value.
145fn add_san(sans: &mut Vec<SanType>, value: &str) {
146 if let Ok(ip) = value.parse::<IpAddr>() {
147 sans.push(SanType::IpAddress(ip));
148 } else if let Ok(dns) = Ia5String::try_from(value) {
149 sans.push(SanType::DnsName(dns));
150 }
151}
152
153#[cfg(test)]
154mod tests {

Callers 1

build_server_sansFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected