monotone

monotone Mtn Source Tree

Root/keys.hh

1#ifndef __KEYS_HH__
2#define __KEYS_HH__
3
4// Copyright (C) 2002 Graydon Hoare <graydon@pobox.com>
5//
6// This program is made available under the GNU GPL version 2.0 or
7// greater. See the accompanying file COPYING for details.
8//
9// This program is distributed WITHOUT ANY WARRANTY; without even the
10// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11// PURPOSE.
12
13#include "vocab.hh"
14
15struct options;
16class lua_hooks;
17class key_store;
18class database;
19struct keypair;
20
21// keys.{hh,cc} does all the "delicate" crypto (meaning: that which needs
22// to read passphrases and manipulate raw, decrypted private keys). it
23// could in theory be in transforms.cc too, but that file's already kinda
24// big and this stuff "feels" different, imho.
25
26void
27get_passphrase(utf8 & phrase,
28 rsa_keypair_id const & keyid,
29 bool confirm_phrase,
30 bool generating_key);
31
32// N()'s out if there is no unique key for us to use
33void get_user_key(options const & opts, lua_hooks & lua,
34 database & db, key_store & keys,
35 rsa_keypair_id & key);
36
37void cache_user_key(options const & opts, lua_hooks & lua,
38 database & db, key_store & keys);
39
40void load_key_pair(key_store & keys,
41 rsa_keypair_id const & id);
42
43void load_key_pair(key_store & keys,
44 rsa_keypair_id const & id,
45 keypair & kp);
46
47// netsync stuff
48
49void key_hash_code(rsa_keypair_id const & ident,
50 rsa_pub_key const & pub,
51 id & out);
52
53void key_hash_code(rsa_keypair_id const & ident,
54 rsa_priv_key const & priv,
55 id & out);
56
57bool keys_match(rsa_keypair_id const & id1,
58 rsa_pub_key const & key1,
59 rsa_keypair_id const & id2,
60 rsa_pub_key const & key2);
61
62// Local Variables:
63// mode: C++
64// fill-column: 76
65// c-file-style: "gnu"
66// indent-tabs-mode: nil
67// End:
68// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:
69
70#endif // __KEYS_HH__

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status