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