rename pemstore to nym-pemstore
This commit is contained in:
Generated
+20
-20
@@ -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"
|
||||
|
||||
@@ -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" }
|
||||
|
||||
@@ -72,17 +72,17 @@ impl KeyManager {
|
||||
/// Loads previously stored client keys from the disk.
|
||||
fn load_client_keys(client_pathfinder: &ClientKeyPathfinder) -> io::Result<Self> {
|
||||
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<SharedKeys, io::Error> =
|
||||
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())?
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ where
|
||||
pathfinder: &ClientKeyPathfinder,
|
||||
) -> Result<identity::KeyPair, ClientCoreError> {
|
||||
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<encryption::KeyPair, ClientCoreError> {
|
||||
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(),
|
||||
))
|
||||
|
||||
@@ -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"] }
|
||||
|
||||
|
||||
@@ -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"] }
|
||||
|
||||
@@ -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" }
|
||||
|
||||
@@ -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"]}
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2021 - Nym Technologies SA <contact@nymtech.net>
|
||||
// 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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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" }
|
||||
|
||||
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "pemstore"
|
||||
name = "nym-pemstore"
|
||||
version = "0.1.0"
|
||||
authors = ["Jedrzej Stuczynski <andrew@nymtech.net>"]
|
||||
edition = "2021"
|
||||
|
||||
+1
-1
@@ -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" }
|
||||
|
||||
@@ -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" }
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -126,18 +126,18 @@ pub async fn execute(args: Init, output: OutputFormat) -> Result<(), Box<dyn Err
|
||||
let identity_keys = identity::KeyPair::new(&mut rng);
|
||||
let sphinx_keys = encryption::KeyPair::new(&mut rng);
|
||||
let pathfinder = GatewayPathfinder::new_from_config(&config);
|
||||
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(),
|
||||
),
|
||||
)
|
||||
.expect("Failed to save sphinx keys");
|
||||
|
||||
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(),
|
||||
),
|
||||
|
||||
@@ -53,7 +53,7 @@ impl TryFrom<Sign> 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(),
|
||||
))
|
||||
|
||||
@@ -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(),
|
||||
))
|
||||
|
||||
+1
-1
@@ -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" }
|
||||
|
||||
@@ -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(),
|
||||
),
|
||||
|
||||
@@ -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(),
|
||||
))
|
||||
|
||||
+1
-1
@@ -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" }
|
||||
|
||||
@@ -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<R: RngCore + Clone> DkgController<R> {
|
||||
coconut_keypair: CoconutKeyPair,
|
||||
rng: R,
|
||||
) -> Result<Self> {
|
||||
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<R: RngCore + Clone> DkgController<R> {
|
||||
.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(),
|
||||
);
|
||||
|
||||
@@ -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?;
|
||||
|
||||
Generated
+9
-9
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user