Enum tor_cert::CertifiedKey
source · #[non_exhaustive]pub enum CertifiedKey {
Ed25519(Ed25519Identity),
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(Ed25519Identity)
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§
source§impl CertifiedKey
impl CertifiedKey
sourcepub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
Return the bytes that are used for the body of this certified key or object.
sourcepub fn as_ed25519(&self) -> Option<&Ed25519Identity>
pub fn as_ed25519(&self) -> Option<&Ed25519Identity>
If this is an Ed25519 public key, return Some(key). Otherwise, return None.
Trait Implementations§
source§impl Clone for CertifiedKey
impl Clone for CertifiedKey
source§fn clone(&self) -> CertifiedKey
fn clone(&self) -> CertifiedKey
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl RefUnwindSafe for CertifiedKey
impl Send for CertifiedKey
impl Sync for CertifiedKey
impl Unpin for CertifiedKey
impl UnwindSafe for CertifiedKey
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more