Struct lock_keeper::crypto::data_blob::DataBlob
source · pub struct DataBlob(pub(super) Secret);
Expand description
A blob of bytes for storing in the server.
The server will encrypt this data before storing it and will decrypt it when client retrieves this data.
Tuple Fields§
§0: Secret
Implementations§
source§impl DataBlob
impl DataBlob
sourceconst GENERATION_TYPE: &'static str = "data blob"
const GENERATION_TYPE: &'static str = "data blob"
Unique identifier used to generate [DataBlob]'s
[AssociatedData]
.
sourcepub fn create(
data: Vec<u8>,
user_id: &UserId,
key_id: &KeyId
) -> Result<Self, LockKeeperError>
pub fn create( data: Vec<u8>, user_id: &UserId, key_id: &KeyId ) -> Result<Self, LockKeeperError>
Create a new [DataBlob]
from the given data. The user_id
and
key_id
are used to create the [DataBlob]'s
[AssociatedData]
(used for encryption/decryption).
sourcefn domain_separator() -> &'static str
fn domain_separator() -> &'static str
Domain separator for use in serializing data blobs.
pub(super) fn context(&self) -> &AssociatedData
Trait Implementations§
source§impl<'de> Deserialize<'de> for DataBlob
impl<'de> Deserialize<'de> for DataBlob
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 PartialEq for DataBlob
impl PartialEq for DataBlob
source§impl TryFrom<DataBlob> for Vec<u8>
impl TryFrom<DataBlob> for Vec<u8>
This implementation is required to use the [Encrypted::encrypt]
function.
source§impl TryFrom<Vec<u8>> for DataBlob
impl TryFrom<Vec<u8>> for DataBlob
This implementation is required to use the [Encrypted::encrypt]
function.
impl Eq for DataBlob
impl StructuralPartialEq for DataBlob
Auto Trait Implementations§
impl Freeze for DataBlob
impl RefUnwindSafe for DataBlob
impl Send for DataBlob
impl Sync for DataBlob
impl Unpin for DataBlob
impl UnwindSafe for DataBlob
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