diff --git a/Cargo.lock b/Cargo.lock index c7355c780b..0dcda65a7a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -708,8 +708,8 @@ dependencies = [ "log", "nonexhaustive-delayqueue", "nym-crypto", + "nym-pemstore", "nymsphinx", - "pemstore", "rand 0.7.3", "serde", "serde_json", @@ -1043,7 +1043,7 @@ dependencies = [ "logging", "network-defaults", "nym-crypto", - "pemstore", + "nym-pemstore", "rand 0.7.3", "serde", "thiserror", @@ -1628,7 +1628,7 @@ dependencies = [ "ff 0.11.1", "group 0.11.0", "lazy_static", - "pemstore", + "nym-pemstore", "rand 0.8.5", "rand_chacha 0.3.1", "rand_core 0.6.4", @@ -2127,8 +2127,8 @@ dependencies = [ "mobile-storage", "network-defaults", "nym-crypto", + "nym-pemstore", "nymsphinx", - "pemstore", "rand 0.7.3", "serde", "task", @@ -2155,8 +2155,8 @@ dependencies = [ "futures", "log", "nym-crypto", + "nym-pemstore", "nymsphinx", - "pemstore", "rand 0.7.3", "serde", "serde_json", @@ -3404,11 +3404,11 @@ dependencies = [ "nym-contracts-common", "nym-crypto", "nym-mixnet-contract-common", + "nym-pemstore", "nym-vesting-contract-common", "nymcoconut", "nymsphinx", "okapi", - "pemstore", "pin-project", "pretty_env_logger", "rand 0.7.3", @@ -3544,8 +3544,8 @@ dependencies = [ "logging", "network-defaults", "nym-crypto", + "nym-pemstore", "nymsphinx", - "pemstore", "pretty_env_logger", "rand 0.7.3", "serde", @@ -3589,8 +3589,8 @@ dependencies = [ "generic-array 0.14.6", "hkdf 0.12.3", "hmac 0.12.1", + "nym-pemstore", "nymsphinx-types", - "pemstore", "rand 0.7.3", "rand_chacha 0.2.2", "serde", @@ -3630,10 +3630,10 @@ dependencies = [ "network-defaults", "nym-api-requests", "nym-crypto", + "nym-pemstore", "nym-types", "nymsphinx", "once_cell", - "pemstore", "pretty_env_logger", "rand 0.7.3", "serde", @@ -3695,11 +3695,11 @@ dependencies = [ "mixnode-common", "nonexhaustive-delayqueue", "nym-crypto", + "nym-pemstore", "nym-types", "nymsphinx", "nymsphinx-params", "nymsphinx-types", - "pemstore", "pretty_env_logger", "rand 0.7.3", "rocket", @@ -3782,6 +3782,13 @@ dependencies = [ "zeroize", ] +[[package]] +name = "nym-pemstore" +version = "0.1.0" +dependencies = [ + "pem", +] + [[package]] name = "nym-sdk" version = "0.1.0" @@ -3830,9 +3837,9 @@ dependencies = [ "mobile-storage", "network-defaults", "nym-crypto", + "nym-pemstore", "nymsphinx", "ordered-buffer", - "pemstore", "pin-project", "pretty_env_logger", "proxy-helpers", @@ -3938,7 +3945,7 @@ dependencies = [ "getrandom 0.2.8", "group 0.11.0", "itertools", - "pemstore", + "nym-pemstore", "rand 0.8.5", "rand_chacha 0.3.1", "serde", @@ -3974,10 +3981,10 @@ name = "nymsphinx-acknowledgements" version = "0.1.0" dependencies = [ "nym-crypto", + "nym-pemstore", "nymsphinx-addressing", "nymsphinx-params", "nymsphinx-types", - "pemstore", "rand 0.7.3", "thiserror", "topology", @@ -4317,13 +4324,6 @@ dependencies = [ "regex", ] -[[package]] -name = "pemstore" -version = "0.1.0" -dependencies = [ - "pem", -] - [[package]] name = "percent-encoding" version = "2.2.0" diff --git a/clients/client-core/Cargo.toml b/clients/client-core/Cargo.toml index 466ce5413b..d168b659ac 100644 --- a/clients/client-core/Cargo.toml +++ b/clients/client-core/Cargo.toml @@ -32,7 +32,7 @@ gateway-client = { path = "../../common/client-libs/gateway-client" } gateway-requests = { path = "../../gateway/gateway-requests" } nonexhaustive-delayqueue = { path = "../../common/nonexhaustive-delayqueue" } nymsphinx = { path = "../../common/nymsphinx" } -pemstore = { path = "../../common/pemstore" } +nym-pemstore = { path = "../../common/pemstore" } topology = { path = "../../common/topology" } validator-client = { path = "../../common/client-libs/validator-client", default-features = false } task = { path = "../../common/task" } diff --git a/clients/client-core/src/client/key_manager.rs b/clients/client-core/src/client/key_manager.rs index 31de4a9a2b..daf71f4679 100644 --- a/clients/client-core/src/client/key_manager.rs +++ b/clients/client-core/src/client/key_manager.rs @@ -72,17 +72,17 @@ impl KeyManager { /// Loads previously stored client keys from the disk. fn load_client_keys(client_pathfinder: &ClientKeyPathfinder) -> io::Result { let identity_keypair: identity::KeyPair = - pemstore::load_keypair(&pemstore::KeyPairPath::new( + nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( client_pathfinder.private_identity_key().to_owned(), client_pathfinder.public_identity_key().to_owned(), ))?; let encryption_keypair: encryption::KeyPair = - pemstore::load_keypair(&pemstore::KeyPairPath::new( + nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( client_pathfinder.private_encryption_key().to_owned(), client_pathfinder.public_encryption_key().to_owned(), ))?; - let ack_key: AckKey = pemstore::load_key(client_pathfinder.ack_key())?; + let ack_key: AckKey = nym_pemstore::load_key(client_pathfinder.ack_key())?; Ok(KeyManager { identity_keypair: Arc::new(identity_keypair), @@ -98,7 +98,7 @@ impl KeyManager { let mut key_manager = Self::load_client_keys(client_pathfinder)?; let gateway_shared_key: SharedKeys = - pemstore::load_key(client_pathfinder.gateway_shared_key())?; + nym_pemstore::load_key(client_pathfinder.gateway_shared_key())?; key_manager.gateway_shared_key = Some(Arc::new(gateway_shared_key)); @@ -113,7 +113,7 @@ impl KeyManager { let mut key_manager = Self::load_client_keys(client_pathfinder)?; let gateway_shared_key: Result = - pemstore::load_key(client_pathfinder.gateway_shared_key()); + nym_pemstore::load_key(client_pathfinder.gateway_shared_key()); // It's ok if the gateway key was not found let gateway_shared_key = match gateway_shared_key { @@ -132,27 +132,27 @@ impl KeyManager { // it is done so for the consistency sake so that you wouldn't require an rng instance // during `load_keys` to generate the said key. pub fn store_keys(&self, client_pathfinder: &ClientKeyPathfinder) -> io::Result<()> { - pemstore::store_keypair( + nym_pemstore::store_keypair( self.identity_keypair.as_ref(), - &pemstore::KeyPairPath::new( + &nym_pemstore::KeyPairPath::new( client_pathfinder.private_identity_key().to_owned(), client_pathfinder.public_identity_key().to_owned(), ), )?; - pemstore::store_keypair( + nym_pemstore::store_keypair( self.encryption_keypair.as_ref(), - &pemstore::KeyPairPath::new( + &nym_pemstore::KeyPairPath::new( client_pathfinder.private_encryption_key().to_owned(), client_pathfinder.public_encryption_key().to_owned(), ), )?; - pemstore::store_key(self.ack_key.as_ref(), client_pathfinder.ack_key())?; + nym_pemstore::store_key(self.ack_key.as_ref(), client_pathfinder.ack_key())?; match self.gateway_shared_key.as_ref() { None => debug!("No gateway shared key available to store!"), Some(gate_key) => { - pemstore::store_key(gate_key.as_ref(), client_pathfinder.gateway_shared_key())? + nym_pemstore::store_key(gate_key.as_ref(), client_pathfinder.gateway_shared_key())? } } @@ -168,7 +168,7 @@ impl KeyManager { )) } Some(gate_key) => { - pemstore::store_key(gate_key.as_ref(), client_pathfinder.gateway_shared_key())? + nym_pemstore::store_key(gate_key.as_ref(), client_pathfinder.gateway_shared_key())? } } diff --git a/clients/client-core/src/init/mod.rs b/clients/client-core/src/init/mod.rs index 287690d7b2..27e25d4972 100644 --- a/clients/client-core/src/init/mod.rs +++ b/clients/client-core/src/init/mod.rs @@ -188,7 +188,7 @@ where pathfinder: &ClientKeyPathfinder, ) -> Result { let identity_keypair: identity::KeyPair = - pemstore::load_keypair(&pemstore::KeyPairPath::new( + nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( pathfinder.private_identity_key().to_owned(), pathfinder.public_identity_key().to_owned(), )) @@ -200,7 +200,7 @@ where pathfinder: &ClientKeyPathfinder, ) -> Result { let sphinx_keypair: encryption::KeyPair = - pemstore::load_keypair(&pemstore::KeyPairPath::new( + nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( pathfinder.private_encryption_key().to_owned(), pathfinder.public_encryption_key().to_owned(), )) diff --git a/clients/credential/Cargo.toml b/clients/credential/Cargo.toml index 4dd23c167e..a693c20d5a 100644 --- a/clients/credential/Cargo.toml +++ b/clients/credential/Cargo.toml @@ -23,6 +23,6 @@ credential-storage = { path = "../../common/credential-storage" } nym-crypto = { path = "../../common/crypto", features = ["rand", "asymmetric", "symmetric", "aes", "hashing"] } logging = { path = "../../common/logging"} network-defaults = { path = "../../common/network-defaults" } -pemstore = { path = "../../common/pemstore" } +nym-pemstore = { path = "../../common/pemstore" } validator-client = { path = "../../common/client-libs/validator-client", features = ["nyxd-client"] } diff --git a/clients/native/Cargo.toml b/clients/native/Cargo.toml index 42254912a8..ed7227bf02 100644 --- a/clients/native/Cargo.toml +++ b/clients/native/Cargo.toml @@ -48,7 +48,7 @@ gateway-client = { path = "../../common/client-libs/gateway-client" } gateway-requests = { path = "../../gateway/gateway-requests" } network-defaults = { path = "../../common/network-defaults" } nymsphinx = { path = "../../common/nymsphinx" } -pemstore = { path = "../../common/pemstore" } +nym-pemstore = { path = "../../common/pemstore" } task = { path = "../../common/task" } topology = { path = "../../common/topology" } validator-client = { path = "../../common/client-libs/validator-client", features = ["nyxd-client"] } diff --git a/clients/socks5/Cargo.toml b/clients/socks5/Cargo.toml index 0650d9b648..397bba0f8f 100644 --- a/clients/socks5/Cargo.toml +++ b/clients/socks5/Cargo.toml @@ -43,7 +43,7 @@ gateway-requests = { path = "../../gateway/gateway-requests" } network-defaults = { path = "../../common/network-defaults" } nymsphinx = { path = "../../common/nymsphinx" } ordered-buffer = { path = "../../common/socks5/ordered-buffer" } -pemstore = { path = "../../common/pemstore" } +nym-pemstore = { path = "../../common/pemstore" } proxy-helpers = { path = "../../common/socks5/proxy-helpers" } service-providers-common = { path = "../../service-providers/common" } socks5-requests = { path = "../../common/socks5/requests" } diff --git a/common/client-libs/gateway-client/Cargo.toml b/common/client-libs/gateway-client/Cargo.toml index 4630104666..dca0679f07 100644 --- a/common/client-libs/gateway-client/Cargo.toml +++ b/common/client-libs/gateway-client/Cargo.toml @@ -24,7 +24,7 @@ nym-crypto = { path = "../../crypto" } gateway-requests = { path = "../../../gateway/gateway-requests" } network-defaults = { path = "../../network-defaults" } nymsphinx = { path = "../../nymsphinx" } -pemstore = { path = "../../pemstore" } +nym-pemstore = { path = "../../pemstore" } validator-client = { path = "../validator-client" } task = { path = "../../task" } serde = { version = "1.0", features = ["derive"]} diff --git a/common/crypto/Cargo.toml b/common/crypto/Cargo.toml index b06237da74..3ae7f0c2ac 100644 --- a/common/crypto/Cargo.toml +++ b/common/crypto/Cargo.toml @@ -26,7 +26,7 @@ thiserror = "1.0.37" # internal nymsphinx-types = { path = "../nymsphinx/types" } -pemstore = { path = "../../common/pemstore" } +nym-pemstore = { path = "../../common/pemstore" } [dev-dependencies] rand_chacha = "0.2" diff --git a/common/crypto/dkg/Cargo.toml b/common/crypto/dkg/Cargo.toml index ea20508321..6b33cf42b2 100644 --- a/common/crypto/dkg/Cargo.toml +++ b/common/crypto/dkg/Cargo.toml @@ -25,7 +25,7 @@ serde_derive = "1.0" thiserror = "1.0" zeroize = { version = "1.4", features = ["zeroize_derive"] } -pemstore = { path = "../../pemstore" } +nym-pemstore = { path = "../../pemstore" } [dependencies.group] version = "0.11" diff --git a/common/crypto/dkg/src/bte/keys.rs b/common/crypto/dkg/src/bte/keys.rs index a2ed0c534d..8d682df757 100644 --- a/common/crypto/dkg/src/bte/keys.rs +++ b/common/crypto/dkg/src/bte/keys.rs @@ -8,7 +8,7 @@ use crate::utils::{deserialize_g1, deserialize_g2, deserialize_scalar}; use bls12_381::{G1Projective, G2Projective, Scalar}; use ff::Field; use group::GroupEncoding; -use pemstore::traits::{PemStorableKey, PemStorableKeyPair}; +use nym_pemstore::traits::{PemStorableKey, PemStorableKeyPair}; use rand_core::RngCore; use zeroize::Zeroize; diff --git a/common/crypto/src/asymmetric/encryption/mod.rs b/common/crypto/src/asymmetric/encryption/mod.rs index 28ff92c07e..6f45a74270 100644 --- a/common/crypto/src/asymmetric/encryption/mod.rs +++ b/common/crypto/src/asymmetric/encryption/mod.rs @@ -1,7 +1,7 @@ // Copyright 2021 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 -use pemstore::traits::{PemStorableKey, PemStorableKeyPair}; +use nym_pemstore::traits::{PemStorableKey, PemStorableKeyPair}; use std::fmt::{self, Display, Formatter}; use thiserror::Error; diff --git a/common/crypto/src/asymmetric/identity/mod.rs b/common/crypto/src/asymmetric/identity/mod.rs index d8f6e2983c..2e77dbb6bf 100644 --- a/common/crypto/src/asymmetric/identity/mod.rs +++ b/common/crypto/src/asymmetric/identity/mod.rs @@ -5,7 +5,7 @@ pub use ed25519_dalek::ed25519::signature::Signature as SignatureTrait; pub use ed25519_dalek::SignatureError; pub use ed25519_dalek::{Verifier, PUBLIC_KEY_LENGTH, SECRET_KEY_LENGTH, SIGNATURE_LENGTH}; use nymsphinx_types::{DestinationAddressBytes, DESTINATION_ADDRESS_LENGTH}; -use pemstore::traits::{PemStorableKey, PemStorableKeyPair}; +use nym_pemstore::traits::{PemStorableKey, PemStorableKeyPair}; use std::fmt::{self, Display, Formatter}; use std::str::FromStr; use thiserror::Error; diff --git a/common/nymcoconut/Cargo.toml b/common/nymcoconut/Cargo.toml index 0aaf2d3770..584bad2ca1 100644 --- a/common/nymcoconut/Cargo.toml +++ b/common/nymcoconut/Cargo.toml @@ -18,7 +18,7 @@ bs58 = "0.4.0" sha2 = "0.9" dkg = { path = "../crypto/dkg" } -pemstore = { path = "../pemstore" } +nym-pemstore = { path = "../pemstore" } [dependencies.ff] version = "0.11" diff --git a/common/nymcoconut/src/scheme/keygen.rs b/common/nymcoconut/src/scheme/keygen.rs index ee694b6c48..352d704193 100644 --- a/common/nymcoconut/src/scheme/keygen.rs +++ b/common/nymcoconut/src/scheme/keygen.rs @@ -9,7 +9,7 @@ use std::convert::TryInto; use bls12_381::{G1Projective, G2Projective, Scalar}; use group::Curve; -use pemstore::traits::{PemStorableKey, PemStorableKeyPair}; +use nym_pemstore::traits::{PemStorableKey, PemStorableKeyPair}; use serde_derive::{Deserialize, Serialize}; use crate::error::{CoconutError, Result}; diff --git a/common/nymsphinx/acknowledgements/Cargo.toml b/common/nymsphinx/acknowledgements/Cargo.toml index d6059dcadb..d9e1b29e7f 100644 --- a/common/nymsphinx/acknowledgements/Cargo.toml +++ b/common/nymsphinx/acknowledgements/Cargo.toml @@ -14,7 +14,7 @@ nym-crypto = { path = "../../crypto", features = ["symmetric", "rand"] } nymsphinx-addressing = { path = "../addressing" } nymsphinx-params = { path = "../params" } nymsphinx-types = { path = "../types" } -pemstore = { path = "../../pemstore" } +nym-pemstore = { path = "../../pemstore" } topology = { path = "../../topology" } diff --git a/common/nymsphinx/acknowledgements/src/key.rs b/common/nymsphinx/acknowledgements/src/key.rs index e67a5c814c..23aaf10987 100644 --- a/common/nymsphinx/acknowledgements/src/key.rs +++ b/common/nymsphinx/acknowledgements/src/key.rs @@ -3,7 +3,7 @@ use nym_crypto::symmetric::stream_cipher::{generate_key, CipherKey, KeySizeUser}; use nymsphinx_params::AckEncryptionAlgorithm; -use pemstore::traits::PemStorableKey; +use nym_pemstore::traits::PemStorableKey; use rand::{CryptoRng, RngCore}; use std::fmt::{self, Display, Formatter}; diff --git a/common/pemstore/Cargo.toml b/common/pemstore/Cargo.toml index db4b331327..854b530b69 100644 --- a/common/pemstore/Cargo.toml +++ b/common/pemstore/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "pemstore" +name = "nym-pemstore" version = "0.1.0" authors = ["Jedrzej Stuczynski "] edition = "2021" diff --git a/gateway/Cargo.toml b/gateway/Cargo.toml index 020fe0627f..66d94cd1e8 100644 --- a/gateway/Cargo.toml +++ b/gateway/Cargo.toml @@ -64,7 +64,7 @@ mixnet-client = { path = "../common/client-libs/mixnet-client" } mixnode-common = { path = "../common/mixnode-common" } network-defaults = { path = "../common/network-defaults" } nymsphinx = { path = "../common/nymsphinx" } -pemstore = { path = "../common/pemstore" } +nym-pemstore = { path = "../common/pemstore" } statistics-common = { path = "../common/statistics" } nym-api-requests = { path = "../nym-api/nym-api-requests" } task = { path = "../common/task" } diff --git a/gateway/gateway-requests/Cargo.toml b/gateway/gateway-requests/Cargo.toml index 4f39cf7038..0b2377c016 100644 --- a/gateway/gateway-requests/Cargo.toml +++ b/gateway/gateway-requests/Cargo.toml @@ -20,7 +20,7 @@ serde_json = "1.0" thiserror = "1.0" nym-crypto = { path = "../../common/crypto" } -pemstore = { path = "../../common/pemstore" } +nym-pemstore = { path = "../../common/pemstore" } coconut-interface = { path = "../../common/coconut-interface" } credentials = { path = "../../common/credentials" } diff --git a/gateway/gateway-requests/src/registration/handshake/shared_key.rs b/gateway/gateway-requests/src/registration/handshake/shared_key.rs index f078b0fd71..13a72e5e22 100644 --- a/gateway/gateway-requests/src/registration/handshake/shared_key.rs +++ b/gateway/gateway-requests/src/registration/handshake/shared_key.rs @@ -9,7 +9,7 @@ use nym_crypto::generic_array::{ use nym_crypto::hmac::{compute_keyed_hmac, recompute_keyed_hmac_and_verify_tag}; use nym_crypto::symmetric::stream_cipher::{self, CipherKey, KeySizeUser, IV}; use nymsphinx::params::{GatewayEncryptionAlgorithm, GatewayIntegrityHmacAlgorithm}; -use pemstore::traits::PemStorableKey; +use nym_pemstore::traits::PemStorableKey; use thiserror::Error; // shared key is as long as the encryption key and the MAC key combined. diff --git a/gateway/src/commands/init.rs b/gateway/src/commands/init.rs index aa5c8fa6db..a21039cac6 100644 --- a/gateway/src/commands/init.rs +++ b/gateway/src/commands/init.rs @@ -126,18 +126,18 @@ pub async fn execute(args: Init, output: OutputFormat) -> Result<(), Box for SignedTarget { } pub fn load_identity_keys(pathfinder: &GatewayPathfinder) -> identity::KeyPair { - let identity_keypair: identity::KeyPair = pemstore::load_keypair(&pemstore::KeyPairPath::new( + let identity_keypair: identity::KeyPair = nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( pathfinder.private_identity_key().to_owned(), pathfinder.public_identity_key().to_owned(), )) diff --git a/gateway/src/node/mod.rs b/gateway/src/node/mod.rs index 0abe019ebb..cbe0fa5ffc 100644 --- a/gateway/src/node/mod.rs +++ b/gateway/src/node/mod.rs @@ -91,7 +91,7 @@ where fn load_identity_keys(pathfinder: &GatewayPathfinder) -> identity::KeyPair { let identity_keypair: identity::KeyPair = - pemstore::load_keypair(&pemstore::KeyPairPath::new( + nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( pathfinder.private_identity_key().to_owned(), pathfinder.public_identity_key().to_owned(), )) @@ -101,7 +101,7 @@ where fn load_sphinx_keys(pathfinder: &GatewayPathfinder) -> encryption::KeyPair { let sphinx_keypair: encryption::KeyPair = - pemstore::load_keypair(&pemstore::KeyPairPath::new( + nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( pathfinder.private_encryption_key().to_owned(), pathfinder.public_encryption_key().to_owned(), )) diff --git a/mixnode/Cargo.toml b/mixnode/Cargo.toml index a45e21ca50..e4345a0c11 100644 --- a/mixnode/Cargo.toml +++ b/mixnode/Cargo.toml @@ -49,7 +49,7 @@ mixnet-client = { path="../common/client-libs/mixnet-client" } mixnode-common = { path="../common/mixnode-common" } nonexhaustive-delayqueue = { path="../common/nonexhaustive-delayqueue" } nymsphinx = { path="../common/nymsphinx" } -pemstore = { path="../common/pemstore" } +nym-pemstore = { path="../common/pemstore" } task = { path = "../common/task" } nym-types = { path = "../common/types" } topology = { path="../common/topology" } diff --git a/mixnode/src/commands/init.rs b/mixnode/src/commands/init.rs index 397da87a10..4aa3f987df 100644 --- a/mixnode/src/commands/init.rs +++ b/mixnode/src/commands/init.rs @@ -85,18 +85,18 @@ pub(crate) fn execute(args: &Init, output: OutputFormat) { let identity_keys = identity::KeyPair::new(&mut rng); let sphinx_keys = encryption::KeyPair::new(&mut rng); let pathfinder = MixNodePathfinder::new_from_config(&config); - pemstore::store_keypair( + nym_pemstore::store_keypair( &identity_keys, - &pemstore::KeyPairPath::new( + &nym_pemstore::KeyPairPath::new( pathfinder.private_identity_key().to_owned(), pathfinder.public_identity_key().to_owned(), ), ) .expect("Failed to save identity keys"); - pemstore::store_keypair( + nym_pemstore::store_keypair( &sphinx_keys, - &pemstore::KeyPairPath::new( + &nym_pemstore::KeyPairPath::new( pathfinder.private_encryption_key().to_owned(), pathfinder.public_encryption_key().to_owned(), ), diff --git a/mixnode/src/node/mod.rs b/mixnode/src/node/mod.rs index df05c0e0bd..4504029bd9 100644 --- a/mixnode/src/node/mod.rs +++ b/mixnode/src/node/mod.rs @@ -65,7 +65,7 @@ impl MixNode { /// Loads identity keys stored on disk pub(crate) fn load_identity_keys(pathfinder: &MixNodePathfinder) -> identity::KeyPair { let identity_keypair: identity::KeyPair = - pemstore::load_keypair(&pemstore::KeyPairPath::new( + nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( pathfinder.private_identity_key().to_owned(), pathfinder.public_identity_key().to_owned(), )) @@ -76,7 +76,7 @@ impl MixNode { /// Loads Sphinx keys stored on disk fn load_sphinx_keys(pathfinder: &MixNodePathfinder) -> encryption::KeyPair { let sphinx_keypair: encryption::KeyPair = - pemstore::load_keypair(&pemstore::KeyPairPath::new( + nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( pathfinder.private_encryption_key().to_owned(), pathfinder.public_encryption_key().to_owned(), )) diff --git a/nym-api/Cargo.toml b/nym-api/Cargo.toml index e47d9a9876..61b524092f 100644 --- a/nym-api/Cargo.toml +++ b/nym-api/Cargo.toml @@ -86,7 +86,7 @@ nym-contracts-common = { path = "../common/cosmwasm-smart-contracts/contracts-co multisig-contract-common = { path = "../common/cosmwasm-smart-contracts/multisig-contract" } nymcoconut = { path = "../common/nymcoconut" } nymsphinx = { path = "../common/nymsphinx" } -pemstore = { path = "../common/pemstore" } +nym-pemstore = { path = "../common/pemstore" } task = { path = "../common/task" } topology = { path = "../common/topology" } nym-api-requests = { path = "nym-api-requests" } diff --git a/nym-api/src/coconut/dkg/controller.rs b/nym-api/src/coconut/dkg/controller.rs index 9c926a7d27..8d32f7dccd 100644 --- a/nym-api/src/coconut/dkg/controller.rs +++ b/nym-api/src/coconut/dkg/controller.rs @@ -27,9 +27,9 @@ pub(crate) fn init_keypair(config: &Config) -> Result<()> { let mut rng = OsRng; let dkg_params = dkg::bte::setup(); let kp = DkgKeyPair::new(&dkg_params, &mut rng); - pemstore::store_keypair( + nym_pemstore::store_keypair( &kp, - &pemstore::KeyPairPath::new( + &nym_pemstore::KeyPairPath::new( config.decryption_key_path(), config.public_key_with_proof_path(), ), @@ -53,11 +53,11 @@ impl DkgController { coconut_keypair: CoconutKeyPair, rng: R, ) -> Result { - let dkg_keypair = pemstore::load_keypair(&pemstore::KeyPairPath::new( + let dkg_keypair = nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( config.decryption_key_path(), config.public_key_with_proof_path(), ))?; - if let Ok(coconut_keypair_value) = pemstore::load_keypair(&pemstore::KeyPairPath::new( + if let Ok(coconut_keypair_value) = nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new( config.secret_key_path(), config.verification_key_path(), )) { @@ -114,7 +114,7 @@ impl DkgController { .await } EpochState::VerificationKeySubmission { resharing } => { - let keypair_path = pemstore::KeyPairPath::new( + let keypair_path = nym_pemstore::KeyPairPath::new( self.secret_key_path.clone(), self.verification_key_path.clone(), ); diff --git a/nym-api/src/coconut/dkg/verification_key.rs b/nym-api/src/coconut/dkg/verification_key.rs index 45637dde5d..9aea96b629 100644 --- a/nym-api/src/coconut/dkg/verification_key.rs +++ b/nym-api/src/coconut/dkg/verification_key.rs @@ -18,7 +18,7 @@ use dkg::error::DkgError; use dkg::{combine_shares, try_recover_verification_keys, Dealing, Threshold}; use nymcoconut::tests::helpers::transpose_matrix; use nymcoconut::{check_vk_pairing, Base58, KeyPair, Parameters, SecretKey, VerificationKey}; -use pemstore::KeyPairPath; +use nym_pemstore::KeyPairPath; use std::collections::BTreeMap; use validator_client::nyxd::cosmwasm_client::logs::find_attribute; @@ -160,7 +160,7 @@ pub(crate) async fn verification_key_submission( deterministic_filter_dealers(dkg_client, state, threshold, resharing).await?; let coconut_keypair = derive_partial_keypair(state, threshold, dealings_maps)?; let vk_share = coconut_keypair.verification_key().to_bs58(); - pemstore::store_keypair(&coconut_keypair, keypair_path)?; + nym_pemstore::store_keypair(&coconut_keypair, keypair_path)?; let res = dkg_client .submit_verification_key_share(vk_share, resharing) .await?; diff --git a/nym-wallet/Cargo.lock b/nym-wallet/Cargo.lock index 240e4bfa5a..c44bb0136b 100644 --- a/nym-wallet/Cargo.lock +++ b/nym-wallet/Cargo.lock @@ -1199,7 +1199,7 @@ dependencies = [ "ff", "group", "lazy_static", - "pemstore", + "nym-pemstore", "rand 0.8.5", "rand_chacha 0.3.1", "rand_core 0.6.4", @@ -2937,6 +2937,13 @@ dependencies = [ "ts-rs", ] +[[package]] +name = "nym-pemstore" +version = "0.1.0" +dependencies = [ + "pem", +] + [[package]] name = "nym-types" version = "1.0.0" @@ -3087,7 +3094,7 @@ dependencies = [ "getrandom 0.2.8", "group", "itertools", - "pemstore", + "nym-pemstore", "rand 0.8.5", "serde", "serde_derive", @@ -3351,13 +3358,6 @@ dependencies = [ "regex", ] -[[package]] -name = "pemstore" -version = "0.1.0" -dependencies = [ - "pem", -] - [[package]] name = "percent-encoding" version = "2.2.0"