pub fn with_key<K: AsRef<[u8]>>(master_key: K) -> Self {
        Self {
            master_key: KeyBytes::copy_slice(master_key.as_ref()),
            user_context: KeyBytes::empty(),
        }
    }
/// Constructs a new cell secured by a master key.
///
/// # Examples
///
/// A master key may be provided as anything convertible to a byte slice: a byte slice or an
/// array, a `Vec<u8>`, or a `String`.
///
/// Note that it is actually _a password_. It is not required to be an actual key generated
/// by one of the [`keygen`] functions (though you definitely can use those keys as well):
///
/// ```
/// use themis::secure_cell::SecureCell;
///
/// SecureCell::with_key(b"byte string");
/// SecureCell::with_key(&[1, 2, 3, 4, 5]);
/// SecureCell::with_key(vec![6, 7, 8, 9]);
/// SecureCell::with_key(format!("owned string"));
/// ```
///
/// This method is equivalent to [`with_key_and_context`] called with an empty context (`&[]`):
///
/// ```
/// # fn main() -> Result<(), themis::Error> {
/// use themis::secure_cell::SecureCell;
///
/// let cell1 = SecureCell::with_key(b"key").seal();
/// let cell2 = SecureCell::with_key_and_context(b"key", &[]).seal();
///
/// let encrypted = cell1.encrypt(b"some data")?;
/// let decrypted = cell2.decrypt(&encrypted)?;
/// assert_eq!(decrypted, b"some data");
/// # Ok(())
/// # }
/// ```
///
/// [`keygen`]: ../keygen/index.html
/// [`with_key_and_context`]: #method.with_key_and_context
Constructs a new cell secured by a master key.
Constructs a new cell secured by a master key .
pub fn with_key<K: AsRef<[u8]>>(master_key: K) -> Self {
        Self {
            master_key: KeyBytes::copy_slice(master_key.as_ref()),
            user_context: KeyBytes::empty(),
        }
    }
pub fn with_key < K : AsRef < [ u8 ] > > ( master_key : K ) -> Self { Self { master_key : KeyBytes :: copy_slice ( master_key . as_ref ( ) ) , user_context : KeyBytes :: empty ( ) , } }
Constructs a new cell secured by a master key.
Constructs a new cell secured by a master key .
master_key
K
master_key
K
examples
A master key may be provided as anything convertible to a byte slice: a byte slice or an
array, a `Vec`, or a `String`.

Note that it is actually _a password_. It is not required to be an actual key generated
by one of the [`keygen`] functions (though you definitely can use those keys as well).

```
use themis::secure_cell::SecureCell.



This method is equivalent to [`with_key_and_context`] called with an empty context (`&[]`).


A master key may be provided as anything convertible to a byte slice : a byte slice or an array a ` Vec ` or a ` String ` . Note that it is actually _a password_ . It is not required to be an actual key generated by one of the [ ` keygen ` ] functions ( though you definitely can use those keys as well ) . ` ` ` use themis :: secure_cell :: SecureCell . This method is equivalent to [ ` with_key_and_context ` ] called with an empty context ( ` & [] ` ) .
fn main() -> result<(), themis::error> {
use themis::secure_cell::SecureCell.

let cell1 = SecureCell::with_key(b"key").seal();
let cell2 = SecureCell::with_key_and_context(b"key", &[]).seal().

let encrypted = cell1.encrypt(b"some data")?;
let decrypted = cell2.decrypt(&encrypted)?;
assert_eq!(decrypted, b"some data").
use themis :: secure_cell :: SecureCell . let cell1 = SecureCell :: with_key ( b " key " ) . seal () ; let cell2 = SecureCell :: with_key_and_context ( b " key " & [] ) . seal () . let encrypted = cell1 . encrypt ( b " some data " ) ? ; let decrypted = cell2 . decrypt ( &encrypted ) ? ; assert_eq! ( decrypted b " some data " ) .
ok(())
None
}


[`keygen`]: ../keygen/index.html
[`with_key_and_context`]: #method.with_key_and_context
[ ` keygen ` ] : .. / keygen / index . html [ ` with_key_and_context ` ] : #method . with_key_and_context