pub struct X509Data {
pub key_size: u32,
pub common_name: String,
pub organization: String,
pub organizational_unit: String,
pub country: String,
pub state: String,
pub alt_host_names: AlternateNames,
pub certificate_duration_days: u32,
}Expand description
Data for constructing an X509 certificate.
Fields§
§key_size: u32Requested key size.
common_name: StringCertificate CN.
organization: StringCertificate organization.
organizational_unit: StringCertificate organizational unit.
country: StringCertificate country.
state: StringCertificate state.
alt_host_names: AlternateNamesA list of alternate host names as text. The first entry is expected to be the application uri. The remainder are treated as IP addresses or DNS names depending on whether they parse as IPv4, IPv6 or neither. IP addresses are expected to be in their canonical form and you will run into trouble especially in IPv6 if they are not because string comparison may be used during validation. e.g. IPv6 canonical format shortens addresses by stripping leading zeros, sequences of zeros and using lowercase hex.
certificate_duration_days: u32The number of days the certificate is valid for, i.e. it will be valid from now until now + duration_days.
Implementations§
Source§impl X509Data
impl X509Data
Sourcepub fn computer_hostnames() -> Vec<String>
pub fn computer_hostnames() -> Vec<String>
Gets a list of possible dns hostnames for this device
Sourcepub fn alt_host_names(
application_uri: &str,
addresses: Option<Vec<String>>,
add_localhost: bool,
add_computer_name: bool,
add_ip_addresses: bool,
) -> AlternateNames
pub fn alt_host_names( application_uri: &str, addresses: Option<Vec<String>>, add_localhost: bool, add_computer_name: bool, add_ip_addresses: bool, ) -> AlternateNames
Create AlternateNames from the current host and application URI, with
an optional extra list of addresses.
Sourcepub fn sample_cert() -> X509Data
pub fn sample_cert() -> X509Data
Creates a sample certificate for testing, sample purposes only