pub enum ConnectionSecurity {
Unsafe,
Native,
Fingerprints(HostCertificateFingerprints),
}
Expand description
The security model chosen for a crate::NetHsm
’s TLS connection
Variants§
Unsafe
Always trust the TLS certificate associated with a host
Native
Use the native trust store to evaluate the trust of a host
Fingerprints(HostCertificateFingerprints)
Use a list of checksums (fingerprints) to verify a host’s TLS certificate
Trait Implementations§
source§impl Clone for ConnectionSecurity
impl Clone for ConnectionSecurity
source§fn clone(&self) -> ConnectionSecurity
fn clone(&self) -> ConnectionSecurity
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 moresource§impl Debug for ConnectionSecurity
impl Debug for ConnectionSecurity
source§impl<'de> Deserialize<'de> for ConnectionSecurity
impl<'de> Deserialize<'de> for ConnectionSecurity
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl FromStr for ConnectionSecurity
impl FromStr for ConnectionSecurity
source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Create a ConnectionSecurity from string
Valid inputs are either “Unsafe” (or “unsafe”), “Native” (or “native”) or “sha256:checksum” where “checksum” denotes 64 ASCII hexadecimal chars.
§Errors
Returns an Error
if the input is neither “Unsafe” nor “Native” and also no valid
certificate fingerprint can be derived from the input.
§Examples
use std::str::FromStr;
use nethsm::ConnectionSecurity;
assert!(ConnectionSecurity::from_str("unsafe").is_ok());
assert!(ConnectionSecurity::from_str("native").is_ok());
assert!(ConnectionSecurity::from_str(
"sha256:324f7bd1530c55cf6812ca6865445de21dfc74cf7a3bb5fae7585e849e3553b7"
)
.is_ok());
assert!(ConnectionSecurity::from_str("something").is_err());
source§impl Hash for ConnectionSecurity
impl Hash for ConnectionSecurity
source§impl PartialEq for ConnectionSecurity
impl PartialEq for ConnectionSecurity
source§impl Serialize for ConnectionSecurity
impl Serialize for ConnectionSecurity
impl Eq for ConnectionSecurity
impl StructuralPartialEq for ConnectionSecurity
Auto Trait Implementations§
impl Freeze for ConnectionSecurity
impl RefUnwindSafe for ConnectionSecurity
impl Send for ConnectionSecurity
impl Sync for ConnectionSecurity
impl Unpin for ConnectionSecurity
impl UnwindSafe for ConnectionSecurity
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)