pub enum ExtensionType {
HasSigningKey = 4,
Unknown = 5,
}Expand description
Types of extensions that can appear in an Ed25519 certificate.
Extensions provide additional data within a certificate, such as the signing key used to create the certificate.
§Stability
This enum is non-exhaustive. New extension types may be added in future Tor protocol versions.
§Example
use stem_rs::descriptor::certificate::ExtensionType;
let ext_type = ExtensionType::from_int(4);
assert_eq!(ext_type, ExtensionType::HasSigningKey);
let unknown = ExtensionType::from_int(99);
assert_eq!(unknown, ExtensionType::Unknown);Variants§
HasSigningKey = 4
Extension contains the 32-byte Ed25519 public key used to sign this certificate.
When present, this extension’s data field contains the signing key that can be used to verify the certificate’s signature.
Unknown = 5
An unrecognized extension type.
Extensions with unknown types are preserved but their semantics are not
interpreted. If the extension has the AffectsValidation flag set,
the certificate should be considered invalid.
Implementations§
Source§impl ExtensionType
impl ExtensionType
Sourcepub fn from_int(val: u8) -> Self
pub fn from_int(val: u8) -> Self
Converts an integer value to an ExtensionType.
§Arguments
val- The integer extension type value from the certificate
§Returns
The corresponding ExtensionType, or ExtensionType::Unknown if
the value is not recognized.
§Example
use stem_rs::descriptor::certificate::ExtensionType;
assert_eq!(ExtensionType::from_int(4), ExtensionType::HasSigningKey);
assert_eq!(ExtensionType::from_int(0), ExtensionType::Unknown);Trait Implementations§
Source§impl Clone for ExtensionType
impl Clone for ExtensionType
Source§fn clone(&self) -> ExtensionType
fn clone(&self) -> ExtensionType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more