Struct tor_cert::CertType

source ·
pub struct CertType(/* private fields */);
Expand description

Recognized values for Tor’s certificate type field.

In the names used here, “X_V_Y” means “key X verifying key Y”, whereas “X_CC_Y” means “key X cross-certifying key Y”. In both cases, X is the key that is doing the signing, and Y is the key or object that is getting signed.

Not every one of these types is valid for an Ed25519 certificate. Some are for X.509 certs in a CERTS cell; some are for RSA->Ed crosscerts in a CERTS cell.

Implementations§

source§

impl CertType

TLS link key, signed with RSA identity. X.509 format. (Obsolete)

source

pub const RSA_ID_X509: CertType = _

Self-signed RSA identity certificate. X.509 format. (Legacy)

RSA lnk authentication key signed with RSA identity key. X.509 format. (Obsolete)

source

pub const IDENTITY_V_SIGNING: CertType = _

Identity verifying a signing key, directly.

source

pub const SIGNING_V_TLS_CERT: CertType = _

Signing key verifying a TLS certificate by digest.

Signing key verifying a link authentication key.

source

pub const RSA_ID_V_IDENTITY: CertType = _

RSA identity key certifying an Ed25519 identity key. RSA crosscert format. (Legacy)

source

pub const HS_BLINDED_ID_V_SIGNING: CertType = _

For onion services: short-term descriptor signing key (KP_hs_desc_sign), signed with blinded onion service identity (KP_hs_blind_id).

source

pub const HS_IP_V_SIGNING: CertType = _

For onion services: Introduction point authentication key (KP_hs_ipt_sid), signed with short term descriptor signing key (KP_hs_desc_sign).

This one is, sadly, a bit complicated. In the original specification it was meant to be a cross-certificate, where the signature would be on the descriptor signing key, signed with the intro TID key. But we got it backwards in the C Tor implementation, and now, for compatibility, we are stuck doing it backwards in the future.

If we find in the future that it is actually important to cross-certify these keys (as originally intended), then we should add a new certificate type, and put the new certificate in the onion service descriptor.

source

pub const NTOR_CC_IDENTITY: CertType = _

An ntor key converted to a ed25519 key, cross-certifying an identity key.

source

pub const HS_IP_CC_SIGNING: CertType = _

For onion services: Ntor encryption key (KP_hss_ntor), converted to ed25519, signed with the descriptor signing key (KP_hs_desc_sign).

As with HS_IP_V_SIGNING, this certificate type is backwards. In the original specification it was meant to be a cross certificate, with the signing and signed keys reversed.

source

pub fn is_recognized(self) -> bool

Return true if this value is one that we recognize.

source

pub fn from_name(name: &str) -> Option<Self>

Try to convert this value from one of the recognized names.

Trait Implementations§

source§

impl Clone for CertType

source§

fn clone(&self) -> CertType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for CertType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for CertType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<CertType> for u8

source§

fn from(val: CertType) -> u8

Converts to this type from the input type.
source§

impl From<u8> for CertType

source§

fn from(num: u8) -> CertType

Converts to this type from the input type.
source§

impl PartialEq for CertType

source§

fn eq(&self, other: &CertType) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for CertType

source§

impl Eq for CertType

source§

impl StructuralPartialEq for CertType

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, 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> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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

§

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