Struct lock_keeper::crypto::cryptor::CryptorContext
source · pub struct CryptorContext {
key_server_name: Vec<u8>,
}
Expand description
The context (a.k.a. associated data).
TODO: We should consider making this a trait and require the calling application to define appropriate context for each of their encrypted types. See issue key-mgmt#542
Fields§
§key_server_name: Vec<u8>
Implementations§
source§impl CryptorContext
impl CryptorContext
sourcepub fn new<T: AsRef<[u8]>>(key_server_name: T) -> Self
pub fn new<T: AsRef<[u8]>>(key_server_name: T) -> Self
Constructs an instance of CryptorContext
.
A type parameter is bounded by the AsRef<[u8]>
trait.
This trait is implemented by types that can be referenced as a byte
slice, e.g. &str
, Vec<u8>
Example usage:
From string slices…
ⓘ
let context = CryptorContext::new("my_key_server");
From Vec<u8>
…
ⓘ
let key_server_name = "my_key_server".as_bytes().to_vec();
let context = CryptorContext::new(key_server_name);
Trait Implementations§
source§impl AsRef<[u8]> for CryptorContext
impl AsRef<[u8]> for CryptorContext
Implement the AsRef<[u8]>
trait for CryptorContext
.
source§impl Clone for CryptorContext
impl Clone for CryptorContext
source§fn clone(&self) -> CryptorContext
fn clone(&self) -> CryptorContext
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 CryptorContext
impl Debug for CryptorContext
source§impl<'de> Deserialize<'de> for CryptorContext
impl<'de> Deserialize<'de> for CryptorContext
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 Display for CryptorContext
impl Display for CryptorContext
An implementation of the std::fmt::Display
trait for CryptorContext
.
source§impl From<CryptorContext> for Vec<u8>
impl From<CryptorContext> for Vec<u8>
Conversion to Vec<u8>
source§fn from(context: CryptorContext) -> Self
fn from(context: CryptorContext) -> Self
Converts to this type from the input type.
source§impl From<Vec<u8>> for CryptorContext
impl From<Vec<u8>> for CryptorContext
Conversion from Vec<u8>
to CryptorContext
source§impl Hash for CryptorContext
impl Hash for CryptorContext
source§impl PartialEq for CryptorContext
impl PartialEq for CryptorContext
source§fn eq(&self, other: &CryptorContext) -> bool
fn eq(&self, other: &CryptorContext) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for CryptorContext
impl Serialize for CryptorContext
impl Eq for CryptorContext
impl StructuralPartialEq for CryptorContext
Auto Trait Implementations§
impl Freeze for CryptorContext
impl RefUnwindSafe for CryptorContext
impl Send for CryptorContext
impl Sync for CryptorContext
impl Unpin for CryptorContext
impl UnwindSafe for CryptorContext
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> ConvertMessage for Twhere
T: for<'a> Deserialize<'a> + Serialize,
impl<T> ConvertMessage for Twhere
T: for<'a> Deserialize<'a> + Serialize,
fn from_message(value: Message) -> Result<Self, LockKeeperError>
fn to_message(self) -> Result<Message, LockKeeperError>
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
§fn combine_to_field_element<F, C>(&self) -> Result<F, Error>where
F: PrimeField,
C: ShareSetCombiner<I, S, F, F>,
fn combine_to_field_element<F, C>(&self) -> Result<F, Error>where
F: PrimeField,
C: ShareSetCombiner<I, S, F, F>,
Convert the given shares into a field element
§fn combine_to_group_element<G, C>(&self) -> Result<G, Error>where
G: Group + GroupEncoding + Default,
C: ShareSetCombiner<I, S, <G as Group>::Scalar, G>,
fn combine_to_group_element<G, C>(&self) -> Result<G, Error>where
G: Group + GroupEncoding + Default,
C: ShareSetCombiner<I, S, <G as Group>::Scalar, G>,
Convert the given shares into a group element
source§impl<T> ToHex for T
impl<T> ToHex for T
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)