00001 #ifndef ENCRYPTION_WRAPPER_CLASS 00002 #define ENCRYPTION_WRAPPER_CLASS 00003 00004 /*****************************************************************************\ 00005 * * 00006 * Name : encryption_wrapper * 00007 * Author : Chris Koeritz * 00008 * * 00009 ******************************************************************************* 00010 * Copyright (c) 2004-$now By Author. This program is free software; you can * 00011 * redistribute it and/or modify it under the terms of the GNU General Public * 00012 * License as published by the Free Software Foundation; either version 2 of * 00013 * the License or (at your option) any later version. This is online at: * 00014 * http://www.fsf.org/copyleft/gpl.html * 00015 * Please send any updates to: fred@gruntose.com * 00016 \*****************************************************************************/ 00017 00018 #ifndef OMIT_CRYPTO_SUPPORT 00019 00020 #include "dll_tentacles.h" 00021 00022 #include <octopus/entity_defs.h> 00023 #include <octopus/infoton.h> 00024 #include <octopus/tentacle_helper.h> 00025 00027 00031 class TENTACLES_CLASS_STYLE encryption_wrapper : public infoton 00032 { 00033 public: 00034 byte_array _wrapped; 00036 00039 encryption_wrapper(const byte_array &wrapped = byte_array::empty_array()); 00040 00041 encryption_wrapper(const encryption_wrapper &to_copy); 00042 00043 virtual ~encryption_wrapper(); 00044 00045 IMPLEMENT_CLASS_NAME("encryption_wrapper"); 00046 00047 encryption_wrapper &operator =(const encryption_wrapper &to_copy); 00048 00049 static const string_array &encryption_classifier(); 00051 00052 virtual void pack(byte_array &packed_form) const; 00053 virtual bool unpack(byte_array &packed_form); 00054 00055 virtual clonable *clone() const; 00056 00057 virtual int packed_size() const; 00058 }; 00059 00061 00063 00067 class TENTACLES_CLASS_STYLE unwrapping_tentacle 00068 : public tentacle_helper<encryption_wrapper> 00069 { 00070 public: 00071 unwrapping_tentacle(); 00072 virtual ~unwrapping_tentacle(); 00073 00074 IMPLEMENT_CLASS_NAME("unwrapping_tentacle"); 00075 00076 virtual outcome reconstitute(const string_array &classifier, 00077 byte_array &packed_form, infoton * &reformed); 00078 00079 virtual outcome consume(infoton &to_chow, const octopus_request_id &item_id, 00080 byte_array &transformed); 00082 }; 00083 00084 #endif // crypto support. 00085 00086 #endif // outer guard. 00087
1.5.1