reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
CertPublicationHandler.cxx
Go to the documentation of this file.
5
6using namespace repro;
7using namespace resip;
8
10{
11}
12
13void
15 const Data& etag,
16 const SipMessage& pub,
17 const Contents* contents,
18 const SecurityAttributes* attrs,
19 uint32_t expires)
20{
21 add(h, contents);
22}
23
24void
26{
27 mSecurity.removeUserCert(h->getPublisher());
28}
29
30void
32 const Data& etag,
33 const SipMessage& pub,
34 const Contents* contents,
35 const SecurityAttributes* attrs,
36 uint32_t expires)
37{
38 if (h->getDocumentKey() == h->getPublisher())
39 {
40 h->send(h->accept(200));
41 }
42 else
43 {
44 h->send(h->accept(403)); // !jf! is this the correct code?
45 }
46}
47
48void
50 const Data& etag,
51 const SipMessage& pub,
52 const Contents* contents,
53 const SecurityAttributes* attrs,
54 uint32_t expires)
55{
56 add(h, contents);
57}
58
59void
61{
62 mSecurity.removeUserCert(h->getPublisher());
63}
64
65void
66CertPublicationHandler::add(ServerPublicationHandle h, const Contents* contents)
67{
68 if (h->getDocumentKey() == h->getPublisher())
69 {
70 const X509Contents* x509 = dynamic_cast<const X509Contents*>(contents);
71 resip_assert(x509);
72 mSecurity.addUserCertDER(h->getPublisher(), x509->getBodyData());
73 h->send(h->accept(200));
74 }
75 else
76 {
77 h->send(h->accept(403)); // !jf! is this the correct code?
78 }
79}
80
81/* ====================================================================
82*
83* Copyright (c) 2015. All rights reserved.
84*
85* Redistribution and use in source and binary forms, with or without
86* modification, are permitted provided that the following conditions
87* are met:
88*
89* 1. Redistributions of source code must retain the above copyright
90* notice, this list of conditions and the following disclaimer.
91*
92* 2. Redistributions in binary form must reproduce the above copyright
93* notice, this list of conditions and the following disclaimer in
94* the documentation and/or other materials provided with the
95* distribution.
96*
97* 3. Neither the name of the author(s) nor the names of any contributors
98* may be used to endorse or promote products derived from this software
99* without specific prior written permission.
100*
101* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) AND CONTRIBUTORS "AS IS" AND
102* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
103* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
104* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OR CONTRIBUTORS BE LIABLE
105* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
106* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
107* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
108* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
109* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
110* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
111* SUCH DAMAGE.
112*
113* ====================================================================
114*
115*/
116/*
117* vi: set shiftwidth=3 expandtab:
118*/
119
#define resip_assert(x)
This file needs to work for both C and C++ code.
virtual void onUpdate(resip::ServerPublicationHandle h, const resip::Data &etag, const resip::SipMessage &pub, const resip::Contents *contents, const resip::SecurityAttributes *attrs, uint32_t expires)
virtual void onInitial(resip::ServerPublicationHandle h, const resip::Data &etag, const resip::SipMessage &pub, const resip::Contents *contents, const resip::SecurityAttributes *attrs, uint32_t expires)
CertPublicationHandler(resip::Security &security)
virtual void onRemoved(resip::ServerPublicationHandle h, const resip::Data &etag, const resip::SipMessage &pub, uint32_t expires)
virtual void onExpired(resip::ServerPublicationHandle h, const resip::Data &etag)
virtual void onRefresh(resip::ServerPublicationHandle, const resip::Data &etag, const resip::SipMessage &pub, const resip::Contents *contents, const resip::SecurityAttributes *attrs, uint32_t expires)
void addUserCertDER(const Data &aor, const Data &certDER)
void removeUserCert(const Data &aor)
Base class for all SIP body types.
Definition Contents.hxx:51
virtual Data getBodyData() const
Definition Contents.cxx:661
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
Represents a SIP message.
SIP body type for holding X509 contents (MIME content-type application/pkix-cert).
This Class is used to implement a primitive form of RPC using loose XML formatting.
dcm! – add UnusedChecking(_enum) below;
unsigned int uint32_t
Definition stdint.h:85