Skip to main content

CsrOptions

Struct CsrOptions 

Source
pub struct CsrOptions { /* private fields */ }
Expand description

Holds configuration options for creating a certificate from a Certificate Signing Request (CSR).

Implementations§

Source§

impl CsrOptions

Source

pub fn new() -> Self

Creates a default CsrOptions instance:

  • valid_from is set to today.
  • valid_to is set to one year from today.
  • ca is set to false.
Source

pub fn valid_from(self, valid_from: &str) -> Self

Sets the start date from which the certificate should be valid.

§Arguments
  • valid_from - A string in the format yyyy-mm-dd.
Source

pub fn valid_to(self, valid_to: &str) -> Self

Sets the end date after which the certificate should no longer be valid.

§Arguments
  • valid_to - A string in the format yyyy-mm-dd.
Source

pub fn is_ca(self, ca: bool) -> Self

Specifies whether the certificate should be a Certificate Authority (CA).

§Arguments
  • ca - true if the certificate should be a CA, false otherwise.
Source

pub fn certificate_policies(self, policies: Vec<CertificatePolicy>) -> Self

Add optional certificate policies

§Arguments
  • policies - A list of certificate policies
Source

pub fn pathlen(self, path_len: u32, chain: Vec<Certificate>) -> Self

Add optional path length, it is the max number of non-self-issued intermediate CA certs that may follow this cert in a chain

§Arguments
  • path_len- u32

Trait Implementations§

Source§

impl Default for CsrOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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.