X509Name

Struct X509Name 

Source
pub struct X509Name<'cert> { /* private fields */ }
Expand description

A borrowed distinguished name (X509_NAME*) tied to its owning X509.

Implementations§

Source§

impl X509Name<'_>

Source

pub fn entry_count(&self) -> usize

Number of entries (RDN components) in the name.

Source

pub fn entry(&self, idx: usize) -> Option<X509NameEntry<'_>>

Access an entry by index (0-based).

Source

pub fn to_oneline(&self) -> Option<String>

Return a one-line string representation of this distinguished name.

Produces the legacy /CN=.../O=.../C=... slash-separated format via X509_NAME_oneline. Useful for logging and debugging, but not recommended for structured access — use Self::entry or Self::to_string (which honours RFC 2253 / RFC 4514 flags) instead.

Returns None if OpenSSL fails to allocate the string.

Source

pub fn to_string(&self) -> Option<String>

Format the entire name as a single-line string.

Uses X509_NAME_print_ex with XN_FLAG_COMPAT (traditional /CN=.../O=.../ format). Returns None on error.

Auto Trait Implementations§

§

impl<'cert> Freeze for X509Name<'cert>

§

impl<'cert> RefUnwindSafe for X509Name<'cert>

§

impl<'cert> !Send for X509Name<'cert>

§

impl<'cert> !Sync for X509Name<'cert>

§

impl<'cert> Unpin for X509Name<'cert>

§

impl<'cert> UnwindSafe for X509Name<'cert>

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, 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, 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.