1 #ifndef ENCRYPTION_INFOTON_CLASS
2 #define ENCRYPTION_INFOTON_CLASS
91 virtual clonable *
clone()
const;
Provides a dynamically resizable ASCII character string.
Defines the base class for all string processing objects in hoople.
virtual base_string & assign(const base_string &s)=0
Sets the contents of this string to "s".
A very common template for a dynamic array of bytes.
static const byte_array & empty_array()
Outcomes describe the state of completion for an operation.
virtual const char * class_name() const =0
Returns the bare name of this class as a constant character pointer.
Provides BlowFish encryption on byte_arrays using the OpenSSL package.
Supports public key encryption and decryption.
Encapsulates the chit-chat necessary to establish an encrypted connection.
basis::outcome prepare_public_key(const crypto::rsa_crypto &private_key)
prepares the request side for a client.
encryption_infoton & operator=(const encryption_infoton &to_copy)
basis::outcome extract_response(const crypto::rsa_crypto &private_key, crypto::blowfish_crypto &new_key) const
used by the client to extract the shared blowfish key from the server.
encryption_infoton(const basis::byte_array &public_key=basis::byte_array::empty_array(), const basis::byte_array &encrypted_blowfish_key=basis::byte_array::empty_array())
DEFINE_CLASS_NAME("encryption_infoton")
virtual int packed_size() const
reports how large the infoton will be when packed.
basis::outcome prepare_both_keys(crypto::rsa_crypto &private_key)
sets up both keys by randomly generating the "private_key".
basis::byte_array _public_key
valid during the request stage of encryption.
basis::outcome prepare_blowfish_key(crypto::blowfish_crypto &new_key)
performs the server side's job on the current key.
virtual clonable * clone() const
must be provided to allow creation of a copy of this object.
basis::outcome _success
did the request succeed?
static const int RSA_KEY_SIZE
this key size should be used for all RSA private keys.
virtual void pack(basis::byte_array &packed_form) const
stuffs the data in the infoton into the "packed_form".
virtual ~encryption_infoton()
static const int BLOWFISH_KEY_SIZE
this will be used for blowfish keys that this object generates.
static const structures::string_array & encryption_classifier()
returns the classifier for this type of infoton.
basis::byte_array _encrypted_blowfish_key
valid during the response stage of encryption.
void text_form(basis::base_string &fill) const
requires derived infotons to be able to show their state as a string.
virtual bool unpack(basis::byte_array &packed_form)
restores an infoton from a packed form.
An infoton is an individual request parcel with accompanying information.
An array of strings with some additional helpful methods.