ENGINE-536: newly refactored key_reset with new functions in. Passes current tests, but need to check new functions.
1 // This file is under GNU General Public License 3.0
9 #include "keymanagement.h"
11 #include "message_api.h"
12 #include "cryptotech.h"
18 // key_reset_identity() - resets trust status for this identity and fpr, and remove
19 // this fpr as a default for all identities and users and from
22 // If the fpr is NULL, we will reset the identity default fpr
23 // as above. When that does not exist, then we do it for
26 // For own identities, when the fpr has a private key part,
27 // also revoke the key and communicate the revocation and new key
28 // to partners we have sent mail to recently from the specific identity
29 // (i.e. address/user_id) that contacted them. We also in this case
30 // set up information so that if someone we mail uses the wrong key
31 // and wasn't yet contacted, we can send them the reset information
32 // from the right address.
35 // session (in) session handle
36 // fpr (in) fingerprint of key to reset. If NULL, we reset the default key
37 // this user, if there is one.
38 // ident (in) identity for which the key reset should occur. Must contain
39 // user_id and address.
41 // fpr field will be ignored. Cannot be NULL.
43 // Note: ident->fpr is always ignored
46 DYNAMIC_API PEP_STATUS key_reset_identity(
52 // key_reset_user() - reset the default key database status for each identity
53 // corresponding to this user and fpr (if present), and remove from
54 // the keyring. This will also remove the key(s) from all other
55 // users and identities. If no fpr is present, reset all default keys
56 // corresponding to this user and its identities.
58 // For own keys, also revoke the key(s) and communicate the
59 // revocation and new key(s) to partners we have sent mail to
60 // recently from the specific identities (i.e. address/user_id)
61 // that contacted them. We also in this case set up information
62 // so that if someone we mail uses the wrong key and wasn't
63 // yet contacted, we can send them the reset information
64 // from the right address.
66 // If the user_id is NULL and fpr is NULL, we reset all keys for the own user.
69 // session (in) session handle
70 // fpr (in) fingerprint of key to reset. If NULL and user_id is NULL,
71 // we reset all keys for the own user. If NULL, we reset all default
72 // keys for this user and all of its identities.
73 // user_id (in) user_id for which the key reset should occur.
74 // If the user_id is NULL, we reset keys for the own user.
76 DYNAMIC_API PEP_STATUS key_reset_user(
82 // key_reset() - reset the database status for a key, removing all trust information
83 // and default database connections. For own keys, also revoke the key
84 // and communicate the revocation and new key to partners we have sent
85 // mail to recently from the specific identity (i.e. address/user_id)
86 // that contacted them. We also in this case set up information so that
87 // if someone we mail uses the wrong key and wasn't yet contacted,
88 // we can send them the reset information from the right address.
90 // Can be called manually or through another protocol.
93 // session (in) session handle
94 // fpr (in) fingerprint of key to reset. If NULL and ident is NULL,
95 // we reset all keys for the own user. If NULL and ident is
96 // an own identity, we reset the default key for that
97 // identity. If that own identity has no default key, we
98 // reset the user default.
99 // if it is NULL and there is a non-own identity, we will reset
100 // the default key for this identity.
101 // ident (in) identity for which the key reset should occur.
102 // if NULL and fpr is non-NULL, we'll reset the key for all
103 // associated identities. If both ident and fpr are NULL, see
104 // the fpr arg documentation.
106 // Note: ident->fpr is always ignored
108 // Caveat: this is now used in large part for internal calls.
109 // external apps should call key_reset_identity and key_reset_userdata
110 // and this function should probably be removed from the dynamic api
111 PEP_STATUS key_reset(
119 PEP_STATUS has_key_reset_been_sent(
122 const char* revoked_fpr,
125 PEP_STATUS set_reset_contact_notified(
127 const char* revoke_fpr,
128 const char* contact_id
131 PEP_STATUS receive_key_reset(PEP_SESSION session,
134 PEP_STATUS create_standalone_key_reset_message(PEP_SESSION session,
138 const char* new_fpr);
140 PEP_STATUS send_key_reset_to_recents(PEP_SESSION session,
142 const char* new_fpr);