/src/resiprocate/resip/stack/Pkcs8Contents.cxx
Line | Count | Source (jump to first uncovered line) |
1 | | #if defined(HAVE_CONFIG_H) |
2 | | #include "config.h" |
3 | | #endif |
4 | | |
5 | | #include "resip/stack/Pkcs8Contents.hxx" |
6 | | #include "resip/stack/SipMessage.hxx" |
7 | | #include "rutil/Logger.hxx" |
8 | | #include "rutil/ParseBuffer.hxx" |
9 | | #include "rutil/WinLeakCheck.hxx" |
10 | | |
11 | | using namespace resip; |
12 | | using namespace std; |
13 | | |
14 | | #define RESIPROCATE_SUBSYSTEM Subsystem::SIP |
15 | | |
16 | | const Pkcs8Contents Pkcs8Contents::Empty; |
17 | | |
18 | | static bool invokePkcs8ContentsInit = Pkcs8Contents::init(); |
19 | | |
20 | | bool |
21 | | Pkcs8Contents::init() |
22 | 2 | { |
23 | 2 | static ContentsFactory<Pkcs8Contents> factory; |
24 | 2 | (void)factory; |
25 | 2 | return true; |
26 | 2 | } |
27 | | |
28 | | Pkcs8Contents::Pkcs8Contents() |
29 | | : Contents(getStaticType()), |
30 | | mText() |
31 | 2 | { |
32 | 2 | } |
33 | | |
34 | | Pkcs8Contents::Pkcs8Contents(const Data& txt) |
35 | | : Contents(getStaticType()), |
36 | | mText(txt) |
37 | 0 | { |
38 | 0 | } |
39 | | |
40 | | Pkcs8Contents::Pkcs8Contents(const Data& txt, const Mime& contentsType) |
41 | | : Contents(contentsType), |
42 | | mText(txt) |
43 | 0 | { |
44 | 0 | } |
45 | | |
46 | | Pkcs8Contents::Pkcs8Contents(const HeaderFieldValue& hfv, const Mime& contentsType) |
47 | | : Contents(hfv, contentsType), |
48 | | mText() |
49 | 6.45k | { |
50 | 6.45k | } |
51 | | |
52 | | Pkcs8Contents::Pkcs8Contents(const Pkcs8Contents& rhs) |
53 | | : Contents(rhs), |
54 | | mText(rhs.mText) |
55 | 0 | { |
56 | 0 | } |
57 | | |
58 | | Pkcs8Contents::~Pkcs8Contents() |
59 | 6.45k | { |
60 | 6.45k | } |
61 | | |
62 | | Pkcs8Contents& |
63 | | Pkcs8Contents::operator=(const Pkcs8Contents& rhs) |
64 | 0 | { |
65 | 0 | if (this != &rhs) |
66 | 0 | { |
67 | 0 | Contents::operator=(rhs); |
68 | 0 | mText = rhs.mText; |
69 | 0 | } |
70 | 0 | return *this; |
71 | 0 | } |
72 | | |
73 | | Contents* |
74 | | Pkcs8Contents::clone() const |
75 | 0 | { |
76 | 0 | return new Pkcs8Contents(*this); |
77 | 0 | } |
78 | | |
79 | | const Mime& |
80 | | Pkcs8Contents::getStaticType() |
81 | 4 | { |
82 | 4 | static Mime type("application", "pkcs8"); |
83 | 4 | return type; |
84 | 4 | } |
85 | | |
86 | | EncodeStream& |
87 | | Pkcs8Contents::encodeParsed(EncodeStream& str) const |
88 | 0 | { |
89 | | //DebugLog(<< "Pkcs8Contents::encodeParsed " << mText); |
90 | 0 | str << mText; |
91 | 0 | return str; |
92 | 0 | } |
93 | | |
94 | | |
95 | | void |
96 | | Pkcs8Contents::parse(ParseBuffer& pb) |
97 | 6.45k | { |
98 | 6.45k | const char* anchor = pb.position(); |
99 | 6.45k | pb.skipToEnd(); |
100 | 6.45k | pb.data(mText, anchor); |
101 | 6.45k | } |
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 | | */ |