Struct diem_config::keys::ConfigKey
source · pub struct ConfigKey<T: PrivateKey + Serialize> { /* private fields */ }
Expand description
ConfigKey places a clonable wrapper around PrivateKeys for config purposes only. The only time configs have keys is either for testing or for low security requirements. Diem recommends that keys be stored in key managers. If we make keys unclonable, then the configs must be mutable and that becomes a requirement strictly as a result of supporting test environments, which is undesirable. Hence this internal wrapper allows for keys to be clonable but only from configs.
Implementations§
source§impl<T: DeserializeOwned + PrivateKey + Serialize> ConfigKey<T>
impl<T: DeserializeOwned + PrivateKey + Serialize> ConfigKey<T>
pub fn private_key(&self) -> T
pub fn public_key(&self) -> T::PublicKeyMaterial
Trait Implementations§
source§impl<'de, T> Deserialize<'de> for ConfigKey<T>where
T: Deserialize<'de> + PrivateKey + Serialize,
impl<'de, T> Deserialize<'de> for ConfigKey<T>where T: Deserialize<'de> + PrivateKey + Serialize,
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
Auto Trait Implementations§
impl<T> RefUnwindSafe for ConfigKey<T>where T: RefUnwindSafe,
impl<T> Send for ConfigKey<T>where T: Send,
impl<T> Sync for ConfigKey<T>where T: Sync,
impl<T> Unpin for ConfigKey<T>where T: Unpin,
impl<T> UnwindSafe for ConfigKey<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> PersistableConfig for Twhere
T: Serialize + DeserializeOwned + ?Sized,
impl<T> PersistableConfig for Twhere T: Serialize + DeserializeOwned + ?Sized,
source§impl<T> Serialize for Twhere
T: Serialize + ?Sized,
impl<T> Serialize for Twhere T: Serialize + ?Sized,
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>
§impl<T> TestOnlyHash for Twhere
T: Serialize + ?Sized,
impl<T> TestOnlyHash for Twhere T: Serialize + ?Sized,
§fn test_only_hash(&self) -> HashValue
fn test_only_hash(&self) -> HashValue
Generates a hash used only for tests.