feisty meow concerns codebase  2.140
encryption_tentacle.h
Go to the documentation of this file.
1 #ifndef ENCRYPTION_TENTACLE_CLASS
2 #define ENCRYPTION_TENTACLE_CLASS
3 
4 /*****************************************************************************\
5 * *
6 * Name : encryption_tentacle *
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 "encryption_infoton.h"
19 
21 
22 namespace octopi {
23 
24 // forward.
25 class key_repository;
26 
28 
41 : public tentacle_helper<encryption_infoton>
42 {
43 public:
46 
49  encryption_tentacle(const basis::byte_array &rsa_key);
51 
55  encryption_tentacle(int key_size);
57 
59  virtual ~encryption_tentacle();
60 
61  DEFINE_CLASS_NAME("encryption_tentacle");
62 
63  virtual basis::outcome reconstitute(const structures::string_array &classifier,
64  basis::byte_array &packed_form, infoton * &reformed);
66 
70  virtual basis::outcome consume(infoton &to_chow, const octopus_request_id &item_id,
71  basis::byte_array &transformed);
73 
79  virtual void expunge(const octopus_entity &to_remove);
81 
82  key_repository &keys() const;
84 
87  const crypto::rsa_crypto &private_key() const;
89 
91 private:
92  bool _server_side;
93  key_repository *_keys;
94  crypto::rsa_crypto *_rsa_private;
95 };
96 
97 } //namespace.
98 
99 #endif // outer guard.
100 
A very common template for a dynamic array of bytes.
Definition: byte_array.h:36
Outcomes describe the state of completion for an operation.
Definition: outcome.h:31
Supports public key encryption and decryption.
Definition: rsa_crypto.h:33
Processes the encryption_infoton object for setting up an encrypted channel.
virtual void expunge(const octopus_entity &to_remove)
throws out any keys we were maintaining for this entity.
key_repository & keys() const
provides access to our list of keys.
const crypto::rsa_crypto & private_key() const
provides access to the key held here.
virtual basis::outcome consume(infoton &to_chow, const octopus_request_id &item_id, basis::byte_array &transformed)
the base class handles the processing of the request in "to_chow".
encryption_tentacle()
this tentacle will implement the server side.
DEFINE_CLASS_NAME("encryption_tentacle")
virtual basis::outcome reconstitute(const structures::string_array &classifier, basis::byte_array &packed_form, infoton *&reformed)
recreates a "reformed" infoton from a packed form.
An infoton is an individual request parcel with accompanying information.
Definition: infoton.h:32
Provides a way of identifying users of an octopus object.
Definition: entity_defs.h:35
Identifies requests made on an octopus by users.
Definition: entity_defs.h:114
provides prefab implementations for parts of the tentacle object.
An array of strings with some additional helpful methods.
Definition: string_array.h:32
Automates some common tasks for tentacle implementations. This template provides some default impleme...