Skip to main content

X509Data

Struct X509Data 

Source
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: u32

Requested key size.

§common_name: String

Certificate CN.

§organization: String

Certificate organization.

§organizational_unit: String

Certificate organizational unit.

§country: String

Certificate country.

§state: String

Certificate state.

§alt_host_names: AlternateNames

A 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: u32

The number of days the certificate is valid for, i.e. it will be valid from now until now + duration_days.

Implementations§

Source§

impl X509Data

Source

pub fn computer_hostnames() -> Vec<String>

Gets a list of possible dns hostnames for this device

Source

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.

Source

pub fn sample_cert() -> X509Data

Creates a sample certificate for testing, sample purposes only

Trait Implementations§

Source§

impl From<(ApplicationDescription, Option<Vec<String>>)> for X509Data

Source§

fn from(v: (ApplicationDescription, Option<Vec<String>>)) -> X509Data

Converts to this type from the input type.
Source§

impl From<ApplicationDescription> for X509Data

Source§

fn from(v: ApplicationDescription) -> X509Data

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoAnyArc for T
where T: Send + Sync + 'static,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Upcast to Arc<dyn Any>.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more