feisty meow concerns codebase  2.140
octopi::encryption_tentacle Class Reference

Processes the encryption_infoton object for setting up an encrypted channel. More...

#include <encryption_tentacle.h>

Inheritance diagram for octopi::encryption_tentacle:
Collaboration diagram for octopi::encryption_tentacle:

Public Member Functions

 encryption_tentacle ()
 this tentacle will implement the server side. More...
 
 encryption_tentacle (const basis::byte_array &rsa_key)
 this is the client side tentacle. More...
 
 encryption_tentacle (int key_size)
 automatically creates a private key of the "key_size". More...
 
virtual ~encryption_tentacle ()
 
 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. More...
 
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". More...
 
virtual void expunge (const octopus_entity &to_remove)
 throws out any keys we were maintaining for this entity. More...
 
key_repositorykeys () const
 provides access to our list of keys. More...
 
const crypto::rsa_cryptoprivate_key () const
 provides access to the key held here. More...
 
- Public Member Functions inherited from octopi::tentacle_helper< encryption_infoton >
 tentacle_helper (const structures::string_array &classifier, bool backgrounded, int motivational_rate=tentacle::DEFAULT_RATE)
 
virtual ~tentacle_helper ()
 force a virtual destructor. More...
 
virtual basis::outcome consume (infoton &formal(to_chow), const octopus_request_id &formal(item_id), basis::byte_array &transformed)
 consume is not really provided here. remember to implement for servers! More...
 
virtual void expunge (const octopus_entity &formal(to_remove))
 no general actions for expunge; they are all class-specific. More...
 
- Public Member Functions inherited from octopi::tentacle
 tentacle (const structures::string_array &group_name, bool backgrounded, int motivational_rate=tentacle::DEFAULT_RATE)
 constructs a tentacle that handles infotons with the "group_name". More...
 
virtual ~tentacle ()
 
 DEFINE_CLASS_NAME ("tentacle")
 
const structures::string_arraygroup () const
 returns the name of the group that this tentacle services. More...
 
bool backgrounding () const
 reports on whether this tentacle supports background operation or not. More...
 
int motivational_rate () const
 returns the background processing rate this was constructed with. More...
 
basis::outcome enqueue (infoton *to_chow, const octopus_request_id &item_id)
 holds onto infotons coming from the octopus for backgrounding. More...
 
infotonnext_request (octopus_request_id &item_id)
 pops out the next queued request for processing. More...
 
bool store_product (infoton *product, const octopus_request_id &original_id)
 used by tentacles to store the objects they produce from infotons. More...
 
void attach_storage (entity_data_bin &storage)
 used when a tentacle is being integrated with an octopus. More...
 
void detach_storage ()
 unhooks the storage bin from this tentacle. More...
 
entity_data_binget_storage ()
 returns the current pointer, which might be nil. More...
 
void propel_arm ()
 invoked by our thread to cause requests to be processed. More...
 

Additional Inherited Members

- Public Types inherited from octopi::tentacle
enum  constants { DEFAULT_RATE = 40 }
 
enum  outcomes {
  OKAY = basis::common::OKAY , NOT_FOUND = basis::common::NOT_FOUND , ALREADY_EXISTS = basis::common::EXISTING , BAD_INPUT = basis::common::BAD_INPUT ,
  NO_SPACE = basis::common::NO_SPACE , GARBAGE = basis::common::GARBAGE , DISALLOWED = basis::common::DISALLOWED , NO_HANDLER = basis::common::NO_HANDLER ,
  PARTIAL = basis::common::PARTIAL , ENCRYPTION_MISMATCH = basis::common::ENCRYPTION_MISMATCH
}
 
- Static Public Member Functions inherited from octopi::tentacle
static const char * outcome_name (const basis::outcome &to_name)
 returns the textual form of the outcome "to_name". More...
 

Detailed Description

Processes the encryption_infoton object for setting up an encrypted channel.

NOTE: to use encryption, both the client and the server need to have an encryption_tentacle added as a filter. it should be the first filter added by users and it must be before any security tentacles (otherwise, the security info would not be encrypted). further, an unwrapping_tentacle (see encryption_wrapper.h) must also be added. it must not be added as a filter. this is what allows the octopus to reconstitute the encoded infotons when encryption is active.

Definition at line 40 of file encryption_tentacle.h.

Constructor & Destructor Documentation

◆ encryption_tentacle() [1/3]

octopi::encryption_tentacle::encryption_tentacle ( )

this tentacle will implement the server side.

it will expect only to see public keys from clients and to respond with encrypted blowfish keys.

Definition at line 41 of file encryption_tentacle.cpp.

◆ encryption_tentacle() [2/3]

octopi::encryption_tentacle::encryption_tentacle ( const basis::byte_array rsa_key)

this is the client side tentacle.

it will only deal with unwrapping a server's response with the encrypted blowfish key. the "rsa_key" is the private key that will be used for decrypting the key response.

Definition at line 50 of file encryption_tentacle.cpp.

◆ encryption_tentacle() [3/3]

octopi::encryption_tentacle::encryption_tentacle ( int  key_size)

automatically creates a private key of the "key_size".

this is for use by the client side's encryption needs.

Definition at line 59 of file encryption_tentacle.cpp.

◆ ~encryption_tentacle()

octopi::encryption_tentacle::~encryption_tentacle ( )
virtual

Definition at line 68 of file encryption_tentacle.cpp.

References basis::WHACK().

Member Function Documentation

◆ consume()

outcome octopi::encryption_tentacle::consume ( infoton to_chow,
const octopus_request_id item_id,
basis::byte_array transformed 
)
virtual

◆ DEFINE_CLASS_NAME()

octopi::encryption_tentacle::DEFINE_CLASS_NAME ( "encryption_tentacle"  )

◆ expunge()

void octopi::encryption_tentacle::expunge ( const octopus_entity to_remove)
virtual

throws out any keys we were maintaining for this entity.

Implements octopi::tentacle.

Definition at line 89 of file encryption_tentacle.cpp.

◆ keys()

key_repository & octopi::encryption_tentacle::keys ( ) const

provides access to our list of keys.

this is very private info, but it's needed for encrypting items going back to the client.

Definition at line 74 of file encryption_tentacle.cpp.

Referenced by cromp::cromp_client::login(), and cromp::cromp_server::wrap_infoton().

◆ private_key()

const rsa_crypto & octopi::encryption_tentacle::private_key ( ) const

provides access to the key held here.

this is an important object; do not expose it externally.

Definition at line 76 of file encryption_tentacle.cpp.

Referenced by cromp::cromp_client::login().

◆ reconstitute()

outcome octopi::encryption_tentacle::reconstitute ( const structures::string_array classifier,
basis::byte_array packed_form,
infoton *&  reformed 
)
virtual

recreates a "reformed" infoton from a packed form.

the "classifier" is provided as well as the packed infoton data in "packed_form". this will only succeed if the classifier's first name is understood here.

Reimplemented from octopi::tentacle_helper< encryption_infoton >.

Definition at line 79 of file encryption_tentacle.cpp.

References octopi::encryption_infoton::encryption_classifier(), octopi::tentacle::NO_HANDLER, NULL_POINTER, and octopi::reconstituter().


The documentation for this class was generated from the following files: