42 #ifndef _DWMAUTHSYMCRYPTOMESSAGE_HH_ 43 #define _DWMAUTHSYMCRYPTOMESSAGE_HH_ 47 #include <cryptopp/aes.h> 49 #include "DwmReadable.hh" 50 #include "DwmSocket.hh" 51 #include "DwmWritable.hh" 63 :
public Readable,
public Writable
69 Message(
const std::string & secret,
const std::string & value =
"");
79 std::string
Value()
const;
84 const std::string &
Value(
const std::string & value);
89 std::istream &
Read(std::istream & is);
94 std::ostream &
Write(std::ostream & os)
const;
100 ssize_t
Read(
int fd);
106 ssize_t
Write(
int fd)
const;
112 size_t Read(FILE *f);
118 size_t Write(FILE *f)
const;
126 ssize_t SendTo(Socket & s,
int flags,
127 const Ipv4Address & dstAddr, uint16_t dstPort);
128 ssize_t RecvFrom(Socket & s,
int flags,
129 Ipv4Address & srcAddr, uint16_t & srcPort);
133 byte _iv[CryptoPP::AES::BLOCKSIZE];
136 ssize_t ReadMsgValue(
int fd);
137 ssize_t WriteMsgValue(
int fd)
const;
138 std::istream & ReadMsgValue(std::istream & is);
139 std::ostream & WriteMsgValue(std::ostream & os)
const;
140 size_t ReadMsgValue(FILE *f);
141 size_t WriteMsgValue(FILE *f)
const;
150 #endif // _DWMAUTHSYMCRYPTOMESSAGE_HH_ Message(const std::string &secret, const std::string &value="")
Constructor with the given secret and value.
Encapsulates an encrypted message.
Definition: DwmAuthSymCryptoMessage.hh:62
Definition: DwmAuth.hh:48
std::ostream & Write(std::ostream &os) const
Writes the message to an ostream. Returns the ostream.
std::istream & Read(std::istream &is)
Reads the message from an istream. Returns the istream.
uint32_t StreamedLength() const
Returns the number of bytes that would be written if one of the Write() members were called...
std::string Value() const
Returns the decrypted value.