Enum tor_cert::CertifiedKey
source · [−]#[non_exhaustive]
pub enum CertifiedKey {
Ed25519(PublicKey),
RsaSha256Digest([u8; 32]),
X509Sha256Digest([u8; 32]),
Unrecognized(UnrecognizedKey),
}Expand description
One of the data types that can be certified by an Ed25519Cert.
Variants (Non-exhaustive)
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Ed25519(PublicKey)
An Ed25519 public key, signed directly.
RsaSha256Digest([u8; 32])
The SHA256 digest of a DER-encoded RsaPublicKey
X509Sha256Digest([u8; 32])
The SHA256 digest of an X.509 certificate.
Unrecognized(UnrecognizedKey)
Some unrecognized key type.
Implementations
sourceimpl CertifiedKey
impl CertifiedKey
sourcepub fn as_bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn as_bytes(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
Return the bytes that are used for the body of this certified key or object.
sourcepub fn as_ed25519(&self) -> Option<&PublicKey>
pub fn as_ed25519(&self) -> Option<&PublicKey>
If this is an Ed25519 public key, return Some(key). Otherwise, return None.
Trait Implementations
sourceimpl Clone for CertifiedKey
impl Clone for CertifiedKey
sourcefn clone(&self) -> CertifiedKey
fn clone(&self) -> CertifiedKey
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
Auto Trait Implementations
impl RefUnwindSafe for CertifiedKey
impl Send for CertifiedKey
impl Sync for CertifiedKey
impl Unpin for CertifiedKey
impl UnwindSafe for CertifiedKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more