reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
X509Contents.cxx
Go to the documentation of this file.
1#if defined(HAVE_CONFIG_H)
2#include "config.h"
3#endif
4
7#include "rutil/Logger.hxx"
10
11using namespace resip;
12using namespace std;
13
14#define RESIPROCATE_SUBSYSTEM Subsystem::SIP
15
17
19
20bool
22{
23 static ContentsFactory<X509Contents> factory;
24 (void)factory;
25 return true;
26}
27
29 : Contents(getStaticType()),
30 mText()
31{
32}
33
35 : Contents(getStaticType()),
36 mText(txt)
37{
38}
39
40X509Contents::X509Contents(const Data& txt, const Mime& contentsType)
41 : Contents(contentsType),
42 mText(txt)
43{
44}
45
46X509Contents::X509Contents(const HeaderFieldValue& hfv, const Mime& contentsType)
47 : Contents(hfv, contentsType),
48 mText()
49{
50}
51
53 : Contents(rhs),
54 mText(rhs.mText)
55{
56}
57
61
64{
65 if (this != &rhs)
66 {
68 mText = rhs.mText;
69 }
70 return *this;
71}
72
75{
76 return new X509Contents(*this);
77}
78
79const Mime&
81{
82 static Mime type("application", "pkix-cert");
83 return type;
84}
85
87X509Contents::encodeParsed(EncodeStream& str) const
88{
89 //DebugLog(<< "X509Contents::encodeParsed " << mText);
90 str << mText;
91 return str;
92}
93
94
95void
97{
98 const char* anchor = pb.position();
99 pb.skipToEnd();
100 pb.data(mText, anchor);
101}
102
103/* ====================================================================
104 * The Vovida Software License, Version 1.0
105 *
106 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
107 *
108 * Redistribution and use in source and binary forms, with or without
109 * modification, are permitted provided that the following conditions
110 * are met:
111 *
112 * 1. Redistributions of source code must retain the above copyright
113 * notice, this list of conditions and the following disclaimer.
114 *
115 * 2. Redistributions in binary form must reproduce the above copyright
116 * notice, this list of conditions and the following disclaimer in
117 * the documentation and/or other materials provided with the
118 * distribution.
119 *
120 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
121 * and "Vovida Open Communication Application Library (VOCAL)" must
122 * not be used to endorse or promote products derived from this
123 * software without prior written permission. For written
124 * permission, please contact vocal@vovida.org.
125 *
126 * 4. Products derived from this software may not be called "VOCAL", nor
127 * may "VOCAL" appear in their name, without prior written
128 * permission of Vovida Networks, Inc.
129 *
130 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
131 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
132 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
133 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
134 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
135 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
136 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
137 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
138 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
139 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
140 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
141 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
142 * DAMAGE.
143 *
144 * ====================================================================
145 *
146 * This software consists of voluntary contributions made by Vovida
147 * Networks, Inc. and many individuals on behalf of Vovida Networks,
148 * Inc. For more information on Vovida Networks, Inc., please see
149 * <http://www.vovida.org/>.
150 *
151 */
static bool invokeX509ContentsInit
Base class for all SIP body types.
Definition Contents.hxx:51
Contents & operator=(const Contents &rhs)
Assignment operator.
Definition Contents.cxx:71
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
Represents the "media-type" element in the RFC 3261 grammar.
Definition Mime.hxx:20
Provides string-parsing functionality with protection from buffer overflow.
CurrentPosition skipToEnd()
CurrentPosition position() const
void data(Data &data, const char *start) const
make the passed in data share memory with the buffer (uses Data::Share)
SIP body type for holding X509 contents (MIME content-type application/pkix-cert).
virtual void parse(ParseBuffer &pb)
virtual EncodeStream & encodeParsed(EncodeStream &str) const
static const X509Contents Empty
static const Mime & getStaticType()
X509Contents & operator=(const X509Contents &rhs)
virtual Contents * clone() const
duplicate an X509Contents object
dcm! – add UnusedChecking(_enum) below;
#define EncodeStream