Struct safe_core::MDataInfo
[−]
[src]
pub struct MDataInfo { pub name: XorName, pub type_tag: u64, pub enc_info: Option<(Key, Nonce)>, pub new_enc_info: Option<(Key, Nonce)>, }
Information allowing to locate and access mutable data on the network.
Fields
name: XorName
Name of the data where the directory is stored.
type_tag: u64
Type tag of the data where the directory is stored.
enc_info: Option<(Key, Nonce)>
Key to encrypt/decrypt the directory content. and the nonce to be used for keys
new_enc_info: Option<(Key, Nonce)>
Future encryption info, used for two-phase data reencryption.
Methods
impl MDataInfo
[src]
fn new_private(name: XorName, type_tag: u64, enc_info: (Key, Nonce)) -> Self
[src]
Construct MDataInfo
for private (encrypted) data with a
provided private key.
fn new_public(name: XorName, type_tag: u64) -> Self
[src]
Construct MDataInfo
for public data.
fn random_private(type_tag: u64) -> Result<Self, CoreError>
[src]
Generate random MDataInfo
for private (encrypted) mutable data.
fn random_public(type_tag: u64) -> Result<Self, CoreError>
[src]
Generate random MDataInfo
for public mutable data.
fn enc_key(&self) -> Option<&Key>
[src]
Returns the encryption key, if any.
fn nonce(&self) -> Option<&Nonce>
[src]
Returns the nonce, inf any.
fn enc_entry_key(&self, plain_text: &[u8]) -> Result<Vec<u8>, CoreError>
[src]
encrypt the key for the mdata entry accordingly
fn enc_entry_value(&self, plain_text: &[u8]) -> Result<Vec<u8>, CoreError>
[src]
encrypt the value for this mdata entry accordingly
fn decrypt(&self, cipher: &[u8]) -> Result<Vec<u8>, CoreError>
[src]
decrypt key or value of this mdata entry
fn start_new_enc_info(&mut self)
[src]
Start the encryption info re-generation by populating the new_enc_info
field with random keys, unless it's already populated.
fn commit_new_enc_info(&mut self)
[src]
Commit the encryption info re-generation by replacing the current encryption info
with new_enc_info
(if any).
fn into_repr_c(self) -> FfiMDataInfo
[src]
Convert into C-representation.
Trait Implementations
impl Clone for MDataInfo
[src]
fn clone(&self) -> MDataInfo
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for MDataInfo
[src]
impl Eq for MDataInfo
[src]
impl PartialEq for MDataInfo
[src]
fn eq(&self, __arg_0: &MDataInfo) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &MDataInfo) -> bool
[src]
This method tests for !=
.
impl ReprC for MDataInfo
[src]
type C = *const FfiMDataInfo
C representation of the type
type Error = IpcError
Error type
unsafe fn clone_from_repr_c(c: Self::C) -> Result<Self, Self::Error>
[src]
Converts from a raw type into an owned type by cloning data