aboutsummaryrefslogtreecommitdiff
path: root/lockchain-crypto
diff options
context:
space:
mode:
Diffstat (limited to 'lockchain-crypto')
-rw-r--r--lockchain-crypto/src/databody.rs7
-rw-r--r--lockchain-crypto/src/engine.rs6
-rw-r--r--lockchain-crypto/src/lib.rs4
3 files changed, 13 insertions, 4 deletions
diff --git a/lockchain-crypto/src/databody.rs b/lockchain-crypto/src/databody.rs
index aaedce7..568710c 100644
--- a/lockchain-crypto/src/databody.rs
+++ b/lockchain-crypto/src/databody.rs
@@ -1,4 +1,9 @@
-//!
+//! A clear-text representation of a record body in memory
+//!
+//! This form is created by the `lockchain-crypto` crate and
+//! should only exist in ephemeral form. All actions are first
+//! encrypted before being written back to a persistence
+//! medium.
use lcc::traits::{AutoEncoder, Body};
use lcc::Payload;
diff --git a/lockchain-crypto/src/engine.rs b/lockchain-crypto/src/engine.rs
index 24d79dc..45470c1 100644
--- a/lockchain-crypto/src/engine.rs
+++ b/lockchain-crypto/src/engine.rs
@@ -2,8 +2,6 @@
//!
//! Can be initialised from scratch or with a pw/salt
//! combintaion which derives a key via the `keybob` crate.
-//!
-//! Implements
use lcc::traits::{AutoEncoder, Encryptable, EncryptionHandler};
use lcc::{EncryptedBody, PackedData};
@@ -25,6 +23,7 @@ pub struct AesEngine {
impl AesEngine {
/// Generate new key and encryption engine
+ #[deprecated]
pub fn generate() -> Self {
let key = Key::new(KeyType::Aes256);
let len = key.len();
@@ -36,6 +35,7 @@ impl AesEngine {
}
/// Generate an Aes context from password
+ #[deprecated]
pub fn from_pw(pw: &str, salt: &str) -> Self {
let key = Key::from_pw(KeyType::Aes256, pw, salt);
let len = key.len();
@@ -47,6 +47,7 @@ impl AesEngine {
}
/// Load a packed data object which contains an Aes context
+ #[deprecated]
pub fn load(packed: PackedData, pw: &str, salt: &str) -> Option<Self> {
let mut temp = Self::from_pw(pw, salt);
let k: Key = Key::decode(&String::from_utf8(temp.decrypt_primitive(&packed)?).ok()?).ok()?;
@@ -59,6 +60,7 @@ impl AesEngine {
}
/// Serialise the current context to save it somewhere
+ #[deprecated]
pub fn save(&mut self) -> PackedData {
let k = self._key.as_slice().into();
self.encrypt_primitive(&k)
diff --git a/lockchain-crypto/src/lib.rs b/lockchain-crypto/src/lib.rs
index a33e8bc..8e64a4c 100644
--- a/lockchain-crypto/src/lib.rs
+++ b/lockchain-crypto/src/lib.rs
@@ -13,6 +13,8 @@ extern crate lockchain_core as lcc;
mod databody;
mod engine;
+mod keyfold;
-pub use databody::*;
+pub use databody::DataBody;
pub use engine::AesEngine;
+pub use keyfold::Keyfold; \ No newline at end of file