reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
MD5Stream.hxx
Go to the documentation of this file.
1#if !defined(RESIP_MD5STREAM_HXX)
2#define RESIP_MD5STREAM_HXX
3
4#include <iostream>
5#include "rutil/compat.hxx"
6#include "rutil/Data.hxx"
7#include "rutil/vmd5.hxx"
8
9#pragma warning(1: 4996) // Move deprecated warnings back to level 1
10
37namespace resip
38{
39
43class MD5Buffer : public std::streambuf
44{
45 public:
46 MD5Buffer();
47 virtual ~MD5Buffer();
50 Data getHex();
51 Data getBin();
52 size_t bytesTaken();
53 protected:
54 virtual int sync();
55 virtual int overflow(int c = -1);
56 private:
57 char mBuf[64];
58 MD5Context mContext;
59 size_t mLen;
60};
61
66class MD5Stream : private MD5Buffer, public std::ostream
67{
68 public:
70 ~MD5Stream();
75 Data getHex();
76 Data getBin();
77 size_t bytesTaken();
78 private:
79 //MD5Buffer mStreambuf;
80};
81
82}
83
84#endif
85/* ====================================================================
86 * The Vovida Software License, Version 1.0
87 *
88 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
89 *
90 * Redistribution and use in source and binary forms, with or without
91 * modification, are permitted provided that the following conditions
92 * are met:
93 *
94 * 1. Redistributions of source code must retain the above copyright
95 * notice, this list of conditions and the following disclaimer.
96 *
97 * 2. Redistributions in binary form must reproduce the above copyright
98 * notice, this list of conditions and the following disclaimer in
99 * the documentation and/or other materials provided with the
100 * distribution.
101 *
102 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
103 * and "Vovida Open Communication Application Library (VOCAL)" must
104 * not be used to endorse or promote products derived from this
105 * software without prior written permission. For written
106 * permission, please contact vocal@vovida.org.
107 *
108 * 4. Products derived from this software may not be called "VOCAL", nor
109 * may "VOCAL" appear in their name, without prior written
110 * permission of Vovida Networks, Inc.
111 *
112 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
113 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
114 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
115 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
116 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
117 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
118 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
119 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
120 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
121 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
122 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
123 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
124 * DAMAGE.
125 *
126 * ====================================================================
127 *
128 * This software consists of voluntary contributions made by Vovida
129 * Networks, Inc. and many individuals on behalf of Vovida Networks,
130 * Inc. For more information on Vovida Networks, Inc., please see
131 * <http://www.vovida.org/>.
132 *
133 */
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
Implementation of std::streambuf used to back the MD5Stream.
Definition MD5Stream.hxx:44
virtual int sync()
Definition MD5Stream.cxx:22
size_t bytesTaken()
Definition MD5Stream.cxx:67
virtual int overflow(int c=-1)
Definition MD5Stream.cxx:36
virtual ~MD5Buffer()
Definition MD5Stream.cxx:17
Used to accumlate data written to the stream in a MD5Buffer and convert the data to MD5.
Definition MD5Stream.hxx:67
Data getHex()
Calls flush() on itself and returns the MD5 data in hex format.
Definition MD5Stream.cxx:81
size_t bytesTaken()
Definition MD5Stream.cxx:96
This file is used to handle compatibility fixes/tweaks so reSIProcate can function on multiple platfo...
#define RESIP_DEPRECATED(x)
Definition compat.hxx:334
dcm! – add UnusedChecking(_enum) below;