aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2021-10-14 12:08:39 +0200
committerAlex Auvolat <alex@adnab.me>2021-10-14 12:08:39 +0200
commitfe16ff25e961e4d40e2641c1247e3b6c3c09e966 (patch)
treef1e60c713326eedff0f54d8b8317b67e1b2a0d15
parent7e49d0dac847cc2a502038eb512255377ac6238a (diff)
downloadnetapp-fe16ff25e961e4d40e2641c1247e3b6c3c09e966.tar.gz
netapp-fe16ff25e961e4d40e2641c1247e3b6c3c09e966.zip
Export NodeKey and NetworkKey types
-rw-r--r--src/lib.rs2
-rw-r--r--src/util.rs4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index bed8821..3162c42 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -26,7 +26,7 @@ pub mod netapp;
pub mod peering;
pub use crate::netapp::*;
-pub use util::NodeID;
+pub use util::{NetworkKey, NodeID, NodeKey};
#[cfg(test)]
mod test;
diff --git a/src/util.rs b/src/util.rs
index fa2f37a..81ee89c 100644
--- a/src/util.rs
+++ b/src/util.rs
@@ -8,6 +8,10 @@ use tokio::sync::watch;
/// A node's identifier, which is also its public cryptographic key
pub type NodeID = sodiumoxide::crypto::sign::ed25519::PublicKey;
+/// A node's secret key
+pub type NodeKey = sodiumoxide::crypto::sign::ed25519::SecretKey;
+/// A network key
+pub type NetworkKey = sodiumoxide::crypto::auth::Key;
/// Utility function: encodes any serializable value in MessagePack binary format
/// using the RMP library.