aboutsummaryrefslogtreecommitdiff
path: root/lockchain-core/src/users/store.rs
diff options
context:
space:
mode:
Diffstat (limited to 'lockchain-core/src/users/store.rs')
-rw-r--r--lockchain-core/src/users/store.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/lockchain-core/src/users/store.rs b/lockchain-core/src/users/store.rs
new file mode 100644
index 0000000..d400668
--- /dev/null
+++ b/lockchain-core/src/users/store.rs
@@ -0,0 +1,39 @@
+use super::rights::Access;
+use super::secrets::SecretType;
+use crypto::Key;
+use std::collections::HashMap;
+
+/// A thin user keystore
+///
+/// It's implementation can manage multiple keys per user, of various
+/// types and constrained for limited access rights.
+pub struct KeyStore {
+ store: HashMap<String, StoreUser>,
+}
+
+struct StoreUser {
+ name: String,
+ keys: HashMap<Access, Key>,
+}
+
+impl KeyStore {
+ /// Create a new, empty keystore
+ ///
+ /// This is most likely *not* what you want. Instead, transform
+ /// a `MetaData` object into a keystore.
+ pub fn new() -> Self {
+ Self {
+ store: HashMap::new(),
+ }
+ }
+
+ pub fn add_user(&mut self) {}
+
+ pub fn rm_user(&mut self) {}
+
+ pub fn add_key(&mut self, user: String, k: Key, access: Access) {}
+
+ pub fn get_key(&self, user: String, access: Access) -> &Key {
+ unimplemented!()
+ }
+}