feisty meow concerns codebase  2.140
key_repository.h
Go to the documentation of this file.
1 #ifndef KEY_REPOSITORY_CLASS
2 #define KEY_REPOSITORY_CLASS
3 
4 /*****************************************************************************\
5 * *
6 * Name : key_repository *
7 * Author : Chris Koeritz *
8 * *
9 *******************************************************************************
10 * Copyright (c) 2004-$now By Author. This program is free software; you can *
11 * redistribute it and/or modify it under the terms of the GNU General Public *
12 * License as published by the Free Software Foundation; either version 2 of *
13 * the License or (at your option) any later version. This is online at: *
14 * http://www.fsf.org/copyleft/gpl.html *
15 * Please send any updates to: fred@gruntose.com *
16 \*****************************************************************************/
17 
18 #include <basis/mutex.h>
19 #include <crypto/blowfish_crypto.h>
21 #include <octopus/entity_defs.h>
22 
23 namespace octopi {
24 
26 
34 {
35 public:
38 
39  octenc_key_record() : _key(200) {}
40 
42  : _entity(entity), _key(key) {}
43 };
44 
46 
48 {
49 public:
50  key_repository() : _locker(), _keys() {}
51  virtual ~key_repository();
52 
53  DEFINE_CLASS_NAME("key_repository");
54 
57 
59  void unlock(octenc_key_record *to_unlock);
61 
64 
67 
68 private:
69  basis::mutex _locker;
71 };
72 
73 } //namespace.
74 
75 #endif // outer guard.
76 
Outcomes describe the state of completion for an operation.
Definition: outcome.h:31
Provides BlowFish encryption on byte_arrays using the OpenSSL package.
DEFINE_CLASS_NAME("key_repository")
basis::outcome whack(const octopus_entity &ent)
removes the key for "ent".
void unlock(octenc_key_record *to_unlock)
drops the lock on the key record in "to_unlock".
basis::outcome add(const octopus_entity &ent, const crypto::blowfish_crypto &key)
adds a "key" for the "ent". this will fail if one is already listed.
octenc_key_record * lock(const octopus_entity &ent)
locates the key for "ent", if it's stored.
Tracks the keys that have been assigned for a secure channel.
octopus_entity _entity
who the key belongs to.
crypto::blowfish_crypto _key
used for communicating with an entity.
octenc_key_record()
bogus blank constructor.
octenc_key_record(const octopus_entity &entity, const crypto::blowfish_crypto &key)
Provides a way of identifying users of an octopus object.
Definition: entity_defs.h:35
Maintains a list of names, where each name has a type and some contents.
Definition: symbol_table.h:36