diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-05-15 16:28:11 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-05-15 16:29:55 +0200 |
commit | a25ef6974e0ba3989f6205c19a1f9ccfc81db584 (patch) | |
tree | 4ce3b386923515a662051c40f67a135ee15681f6 /ffi/include | |
parent | 36e2d97ac013e023feb27df939c3f6d6e32d8669 (diff) |
core, store, tool: Use realm instead of domain.
- Remove the domain parameter from core::Context.
- Replace it with a realm to be passed in when opening a store.
- For sq, merge store name and realm into the --store parameter.
- Fixes #105.
Diffstat (limited to 'ffi/include')
-rw-r--r-- | ffi/include/sequoia/core.h | 19 | ||||
-rw-r--r-- | ffi/include/sequoia/store.h | 26 |
2 files changed, 21 insertions, 24 deletions
diff --git a/ffi/include/sequoia/core.h b/ffi/include/sequoia/core.h index d34f8985..c7f73f45 100644 --- a/ffi/include/sequoia/core.h +++ b/ffi/include/sequoia/core.h @@ -14,7 +14,7 @@ /// # Example /// /// ```c -/// struct sq_context *ctx sq_context_new("org.sequoia-pgp.example"); +/// struct sq_context *ctx sq_context_new(); /// if (ctx == NULL) { ... } /// ``` /*/ @@ -125,14 +125,10 @@ typedef enum sq_ipc_policy { /*/ /// Creates a Context with reasonable defaults. /// -/// `domain` should uniquely identify your application, it is strongly -/// suggested to use a reversed fully qualified domain name that is -/// associated with your application. `domain` must not be `NULL`. -/// /// Returns `NULL` on errors. If `errp` is not `NULL`, the error is /// stored there. /*/ -sq_context_t sq_context_new(const char *domain, pgp_error_t *errp); +sq_context_t sq_context_new(pgp_error_t *errp); /*/ /// Frees a context. @@ -142,20 +138,11 @@ void sq_context_free(sq_context_t context); /*/ /// Creates a Context that can be configured. /// -/// `domain` should uniquely identify your application, it is strongly -/// suggested to use a reversed fully qualified domain name that is -/// associated with your application. `domain` must not be `NULL`. -/// /// The configuration is seeded like in `sq_context_new`, but can be /// modified. A configuration has to be finalized using /// `sq_config_build()` in order to turn it into a Context. /*/ -sq_config_t sq_context_configure(const char *domain); - -/*/ -/// Returns the domain of the context. -/*/ -const char *sq_context_domain(const sq_context_t ctx); +sq_config_t sq_context_configure(void); /*/ /// Returns the directory containing shared state. diff --git a/ffi/include/sequoia/store.h b/ffi/include/sequoia/store.h index 343e52ab..47b581b1 100644 --- a/ffi/include/sequoia/store.h +++ b/ffi/include/sequoia/store.h @@ -4,6 +4,16 @@ #include <sequoia/core.h> /*/ +/// Keys used for communications. +/*/ +const char *SQ_REALM_CONTACTS = "org.sequoia-pgp.contacts"; + +/*/ +/// Keys used for signing software updates. +/*/ +const char *SQ_REALM_SOFTWARE_UPDATES = "org.sequoia-pgp.software-updates"; + +/*/ /// A public key store. /*/ typedef struct sq_store *sq_store_t; @@ -156,13 +166,13 @@ typedef struct sq_store_iter *sq_store_iter_t; /*/ /// Returns the next store. /// -/// Returns `NULL` on exhaustion. If `domainp` is not `NULL`, the -/// stores domain is stored there. If `namep` is not `NULL`, the +/// Returns `NULL` on exhaustion. If `realmp` is not `NULL`, the +/// stores realm is stored there. If `namep` is not `NULL`, the /// stores name is stored there. If `policyp` is not `NULL`, the /// stores network policy is stored there. /*/ sq_store_t sq_store_iter_next (sq_store_iter_t iter, - char **domainp, + char **realmp, char **namep, uint8_t *policyp); @@ -242,17 +252,17 @@ sq_key_iter_t sq_store_list_keys (sq_context_t ctx); /*/ /// Opens a store. /// -/// Opens a store with the given name. If the store does not -/// exist, it is created. Stores are handles for objects -/// maintained by a background service. The background service -/// associates state with this name. +/// Opens a store with the given name in the given realm. If the +/// store does not exist, it is created. Stores are handles for +/// objects maintained by a background service. The background +/// service associates state with this name. /// /// The store updates TPKs in compliance with the network policy /// of the context that created the store in the first place. /// Opening the store with a different network policy is /// forbidden. /*/ -sq_store_t sq_store_open (sq_context_t ctx, const char *name); +sq_store_t sq_store_open (sq_context_t ctx, const char *realm, const char *name); /*/ /// Adds a key identified by fingerprint to the store. |