summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ffi/src/store.rs10
-rw-r--r--store/src/lib.rs38
-rw-r--r--tool/src/commands/mod.rs2
-rw-r--r--tool/src/sq.rs4
4 files changed, 27 insertions, 27 deletions
diff --git a/ffi/src/store.rs b/ffi/src/store.rs
index bdd59c53..abf47962 100644
--- a/ffi/src/store.rs
+++ b/ffi/src/store.rs
@@ -29,7 +29,7 @@ use std::ptr;
extern crate sequoia_openpgp as openpgp;
use sequoia_store::{
- self, Mapping, MappingIter, Binding, BindingIter, Key, KeyIter, LogIter, Pool,
+ self, Mapping, MappingIter, Binding, BindingIter, Key, KeyIter, LogIter, Store,
};
use super::error::Status;
@@ -100,7 +100,7 @@ fn sq_store_list_keys(ctx: *mut Context) -> *mut KeyIter {
let ctx = ffi_param_ref_mut!(ctx);
ffi_make_fry_from_ctx!(ctx);
- ffi_try_box!(Pool::list_keys(&ctx.c))
+ ffi_try_box!(Store::list_keys(&ctx.c))
}
/// Lists all log entries.
@@ -109,7 +109,7 @@ fn sq_store_server_log(ctx: *mut Context) -> *mut LogIter {
let ctx = ffi_param_ref_mut!(ctx);
ffi_make_fry_from_ctx!(ctx);
- ffi_try_box!(Pool::server_log(&ctx.c))
+ ffi_try_box!(Store::server_log(&ctx.c))
}
/// Returns the next key.
@@ -263,7 +263,7 @@ fn sq_store_lookup_by_keyid(ctx: *mut Context, keyid: *const KeyID)
ffi_make_fry_from_ctx!(ctx);
let keyid = keyid.ref_raw();
- ffi_try_box!(Pool::lookup_by_keyid(&ctx.c, keyid))
+ ffi_try_box!(Store::lookup_by_keyid(&ctx.c, keyid))
}
/// Looks up a key in the common key pool by (Sub)KeyID.
@@ -275,7 +275,7 @@ fn sq_store_lookup_by_subkeyid(ctx: *mut Context, keyid: *const KeyID)
ffi_make_fry_from_ctx!(ctx);
let keyid = keyid.ref_raw();
- ffi_try_box!(Pool::lookup_by_subkeyid(&ctx.c, keyid))
+ ffi_try_box!(Store::lookup_by_subkeyid(&ctx.c, keyid))
}
/// Deletes this mapping.
diff --git a/store/src/lib.rs b/store/src/lib.rs
index fdb52439..9e710a9b 100644
--- a/store/src/lib.rs
+++ b/store/src/lib.rs
@@ -116,10 +116,10 @@ pub const REALM_SOFTWARE_UPDATES: &'static str =
"org.sequoia-pgp.software-updates";
/// The common key pool.
-pub struct Pool {
+pub struct Store {
}
-impl Pool {
+impl Store {
/// Establishes a connection to the backend.
fn connect(c: &Context) -> Result<(Core, node::Client)> {
let descriptor = descriptor(c);
@@ -149,7 +149,7 @@ impl Pool {
/// # use openpgp::TPK;
/// # use openpgp::parse::Parse;
/// # use sequoia_core::{Context, NetworkPolicy, IPCPolicy};
- /// # use sequoia_store::{Pool, Result};
+ /// # use sequoia_store::{Store, Result};
/// # fn main() { f().unwrap(); }
/// # fn f() -> Result<()> {
/// # let ctx = Context::configure()
@@ -158,7 +158,7 @@ impl Pool {
/// # .ephemeral().build()?;
/// # let tpk = TPK::from_bytes(
/// # include_bytes!("../../openpgp/tests/data/keys/testy.pgp")).unwrap();
- /// let key = Pool::import(&ctx, &tpk)?;
+ /// let key = Store::import(&ctx, &tpk)?;
/// assert_eq!(key.tpk()?.fingerprint(), tpk.fingerprint());
/// # Ok(())
/// # }
@@ -185,7 +185,7 @@ impl Pool {
/// # use openpgp::TPK;
/// # use openpgp::parse::Parse;
/// # use sequoia_core::{Context, NetworkPolicy, IPCPolicy};
- /// # use sequoia_store::{Pool, Result};
+ /// # use sequoia_store::{Store, Result};
/// # fn main() { f().unwrap(); }
/// # fn f() -> Result<()> {
/// # let ctx = Context::configure()
@@ -194,8 +194,8 @@ impl Pool {
/// # .ephemeral().build()?;
/// # let tpk = TPK::from_bytes(
/// # include_bytes!("../../openpgp/tests/data/keys/testy.pgp")).unwrap();
- /// Pool::import(&ctx, &tpk)?;
- /// let key = Pool::lookup(&ctx, &tpk.fingerprint())?;
+ /// Store::import(&ctx, &tpk)?;
+ /// let key = Store::lookup(&ctx, &tpk.fingerprint())?;
/// assert_eq!(key.tpk()?.fingerprint(), tpk.fingerprint());
/// # Ok(())
/// # }
@@ -220,7 +220,7 @@ impl Pool {
/// # use openpgp::TPK;
/// # use openpgp::parse::Parse;
/// # use sequoia_core::{Context, NetworkPolicy, IPCPolicy};
- /// # use sequoia_store::{Pool, Result};
+ /// # use sequoia_store::{Store, Result};
/// # fn main() { f().unwrap(); }
/// # fn f() -> Result<()> {
/// # let ctx = Context::configure()
@@ -229,8 +229,8 @@ impl Pool {
/// # .ephemeral().build()?;
/// # let tpk = TPK::from_bytes(
/// # include_bytes!("../../openpgp/tests/data/keys/testy.pgp")).unwrap();
- /// Pool::import(&ctx, &tpk)?;
- /// let key = Pool::lookup_by_keyid(&ctx, &tpk.fingerprint().to_keyid())?;
+ /// Store::import(&ctx, &tpk)?;
+ /// let key = Store::lookup_by_keyid(&ctx, &tpk.fingerprint().to_keyid())?;
/// assert_eq!(key.tpk()?.fingerprint(), tpk.fingerprint());
/// # Ok(())
/// # }
@@ -256,7 +256,7 @@ impl Pool {
/// # use openpgp::{TPK, KeyID};
/// # use openpgp::parse::Parse;
/// # use sequoia_core::{Context, NetworkPolicy, IPCPolicy};
- /// # use sequoia_store::{Pool, Result};
+ /// # use sequoia_store::{Store, Result};
/// # fn main() { f().unwrap(); }
/// # fn f() -> Result<()> {
/// # let ctx = Context::configure()
@@ -266,22 +266,22 @@ impl Pool {
/// # let tpk = TPK::from_bytes(
/// # include_bytes!("../../openpgp/tests/data/keys/neal.pgp"))
/// # .unwrap();
- /// Pool::import(&ctx, &tpk)?;
+ /// Store::import(&ctx, &tpk)?;
///
/// // Lookup by the primary key's KeyID.
- /// let key = Pool::lookup_by_subkeyid(&ctx, &"AACB3243630052D9".parse()?)?;
+ /// let key = Store::lookup_by_subkeyid(&ctx, &"AACB3243630052D9".parse()?)?;
/// assert_eq!(key.tpk()?.fingerprint(), tpk.fingerprint());
///
/// // Lookup by the signing subkey's KeyID.
- /// let key = Pool::lookup_by_subkeyid(&ctx, &"7223B56678E02528".parse()?)?;
+ /// let key = Store::lookup_by_subkeyid(&ctx, &"7223B56678E02528".parse()?)?;
/// assert_eq!(key.tpk()?.fingerprint(), tpk.fingerprint());
///
/// // Lookup by the encryption subkey's KeyID.
- /// let key = Pool::lookup_by_subkeyid(&ctx, &"C2B819056C652598".parse()?)?;
+ /// let key = Store::lookup_by_subkeyid(&ctx, &"C2B819056C652598".parse()?)?;
/// assert_eq!(key.tpk()?.fingerprint(), tpk.fingerprint());
///
/// // Lookup by the authentication subkey's KeyID.
- /// let key = Pool::lookup_by_subkeyid(&ctx, &"A3506AFB820ABD08".parse()?)?;
+ /// let key = Store::lookup_by_subkeyid(&ctx, &"A3506AFB820ABD08".parse()?)?;
/// assert_eq!(key.tpk()?.fingerprint(), tpk.fingerprint());
/// # Ok(())
/// # }
@@ -337,7 +337,7 @@ impl Mapping {
/// Opening the mapping with a different network policy is
/// forbidden.
pub fn open(c: &Context, realm: &str, name: &str) -> Result<Self> {
- let (mut core, client) = Pool::connect(c)?;
+ let (mut core, client) = Store::connect(c)?;
let mut request = client.open_request();
request.get().set_realm(realm);
@@ -355,7 +355,7 @@ impl Mapping {
/// Lists all mappings with the given prefix.
pub fn list(c: &Context, realm_prefix: &str) -> Result<MappingIter> {
- let (mut core, client) = Pool::connect(c)?;
+ let (mut core, client) = Store::connect(c)?;
let mut request = client.iter_request();
request.get().set_realm_prefix(realm_prefix);
let iter = make_request!(&mut core, request)?;
@@ -1484,7 +1484,7 @@ mod test {
#[test]
fn key_iterator() {
let ctx = make_some_mappings();
- let mut iter = Pool::list_keys(&ctx).unwrap();
+ let mut iter = Store::list_keys(&ctx).unwrap();
let (fingerprint, key) = iter.next().unwrap();
assert_eq!(fingerprint, Fingerprint::from_bytes(b"bbbbbbbbbbbbbbbbbbbb"));
key.stats().unwrap();
diff --git a/tool/src/commands/mod.rs b/tool/src/commands/mod.rs
index de671fa6..37f0852f 100644
--- a/tool/src/commands/mod.rs
+++ b/tool/src/commands/mod.rs
@@ -322,7 +322,7 @@ impl<'a> VerificationHelper for VHelper<'a> {
// Try to get missing TPKs from the pool.
for id in ids.iter().filter(|i| !seen.contains(i)) {
let _ =
- store::Pool::lookup_by_subkeyid(self.ctx, id)
+ store::Store::lookup_by_subkeyid(self.ctx, id)
.and_then(|key| {
// Keys from the pool are NOT trusted.
key.tpk()
diff --git a/tool/src/sq.rs b/tool/src/sq.rs
index 94486ac7..78e571d3 100644
--- a/tool/src/sq.rs
+++ b/tool/src/sq.rs
@@ -490,7 +490,7 @@ fn real_main() -> Result<(), failure::Error> {
table.set_format(*prettytable::format::consts::FORMAT_NO_LINESEP_WITH_TITLE);
table.set_titles(row!["fingerprint", "updated", "status"]);
- for (fingerprint, key) in store::Pool::list_keys(&ctx)? {
+ for (fingerprint, key) in store::Store::list_keys(&ctx)? {
let stats = key.stats()
.context("Failed to get key stats")?;
table.add_row(Row::new(vec![
@@ -507,7 +507,7 @@ fn real_main() -> Result<(), failure::Error> {
table.printstd();
},
("log", Some(_)) => {
- print_log(store::Pool::server_log(&ctx)?, true);
+ print_log(store::Store::server_log(&ctx)?, true);
},
_ => unreachable!(),
}