Skip to main content

Authority

Struct Authority 

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

The authority’s certificate and the key that signs with it.

Implementations§

Source§

impl Authority

Source

pub fn create(suffix: &str) -> Result<Self>

Create an authority permitted to vouch for suffix and nothing else.

Source

pub fn certificate_pem(&self) -> &str

The authority’s certificate, as PEM. The half that is safe to hand out.

Source

pub fn suffix(&self) -> &str

Source

pub fn leaf_for(&self, name: &str) -> Result<Leaf>

A certificate for one name under the suffix.

One concrete name, not a wildcard, and that is a measured decision rather than a preference. *.ssh-browser is refused by Chromium with ERR_CERT_COMMON_NAME_INVALID: the suffix is not a known registry, so a wildcard directly beneath it reads as one spanning an entire top-level domain, which no browser will accept. A certificate naming e2e.ssh-browser outright, from the same authority, loads — with isSecureContext, service workers and crypto.subtle all present, which is the whole point of the mode.

So there is one certificate per alias, minted when a handshake first asks for that name.

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.