Struct safe_app::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]
impl MDataInfo
pub fn new_private(
name: XorName,
type_tag: u64,
enc_info: (Key, Nonce)
) -> MDataInfo
[src]
pub fn new_private(
name: XorName,
type_tag: u64,
enc_info: (Key, Nonce)
) -> MDataInfo
Construct MDataInfo
for private (encrypted) data with a
provided private key.
pub fn new_public(name: XorName, type_tag: u64) -> MDataInfo
[src]
pub fn new_public(name: XorName, type_tag: u64) -> MDataInfo
Construct MDataInfo
for public data.
pub fn random_private(type_tag: u64) -> Result<MDataInfo, CoreError>
[src]
pub fn random_private(type_tag: u64) -> Result<MDataInfo, CoreError>
Generate random MDataInfo
for private (encrypted) mutable data.
pub fn random_public(type_tag: u64) -> Result<MDataInfo, CoreError>
[src]
pub fn random_public(type_tag: u64) -> Result<MDataInfo, CoreError>
Generate random MDataInfo
for public mutable data.
pub fn enc_key(&self) -> Option<&Key>
[src]
pub fn enc_key(&self) -> Option<&Key>
Returns the encryption key, if any.
pub fn nonce(&self) -> Option<&Nonce>
[src]
pub fn nonce(&self) -> Option<&Nonce>
Returns the nonce, inf any.
pub fn enc_entry_key(&self, plain_text: &[u8]) -> Result<Vec<u8>, CoreError>
[src]
pub fn enc_entry_key(&self, plain_text: &[u8]) -> Result<Vec<u8>, CoreError>
encrypt the key for the mdata entry accordingly
pub fn enc_entry_value(&self, plain_text: &[u8]) -> Result<Vec<u8>, CoreError>
[src]
pub fn enc_entry_value(&self, plain_text: &[u8]) -> Result<Vec<u8>, CoreError>
encrypt the value for this mdata entry accordingly
pub fn decrypt(&self, cipher: &[u8]) -> Result<Vec<u8>, CoreError>
[src]
pub fn decrypt(&self, cipher: &[u8]) -> Result<Vec<u8>, CoreError>
decrypt key or value of this mdata entry
pub fn start_new_enc_info(&mut self)
[src]
pub fn start_new_enc_info(&mut self)
Start the encryption info re-generation by populating the new_enc_info
field with random keys, unless it's already populated.
pub fn commit_new_enc_info(&mut self)
[src]
pub fn commit_new_enc_info(&mut self)
Commit the encryption info re-generation by replacing the current encryption info
with new_enc_info
(if any).
pub fn into_repr_c(self) -> MDataInfo
[src]
pub fn into_repr_c(self) -> MDataInfo
Convert into C-representation.
Trait Implementations
impl<'de> Deserialize<'de> for MDataInfo
[src]
impl<'de> Deserialize<'de> for MDataInfo
fn deserialize<__D>(
__deserializer: __D
) -> Result<MDataInfo, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(
__deserializer: __D
) -> Result<MDataInfo, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Clone for MDataInfo
[src]
impl Clone for MDataInfo
fn clone(&self) -> MDataInfo
[src]
fn clone(&self) -> MDataInfo
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl ReprC for MDataInfo
[src]
impl ReprC for MDataInfo
type C = *const MDataInfo
C representation of the type
type Error = IpcError
Error type
unsafe fn clone_from_repr_c(
c: <MDataInfo as ReprC>::C
) -> Result<MDataInfo, <MDataInfo as ReprC>::Error>
[src]
unsafe fn clone_from_repr_c(
c: <MDataInfo as ReprC>::C
) -> Result<MDataInfo, <MDataInfo as ReprC>::Error>
Converts from a raw type into an owned type by cloning data
impl Debug for MDataInfo
[src]
impl Debug for MDataInfo
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl Eq for MDataInfo
[src]
impl Eq for MDataInfo
impl PartialEq<MDataInfo> for MDataInfo
[src]
impl PartialEq<MDataInfo> for MDataInfo
fn eq(&self, other: &MDataInfo) -> bool
[src]
fn eq(&self, other: &MDataInfo) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &MDataInfo) -> bool
[src]
fn ne(&self, other: &MDataInfo) -> bool
This method tests for !=
.
impl Serialize for MDataInfo
[src]
impl Serialize for MDataInfo
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more