privatekeysubscriptionhandler.cxx

来自「这是国外的resip协议栈」· CXX 代码 · 共 54 行

CXX
54
字号
#if defined(USE_SSL)#include "resip/stack/Pkcs8Contents.hxx"#include "resip/stack/Security.hxx"#include "resip/dum/ServerSubscription.hxx"#include "resip/dum/ServerPublication.hxx"#include "repro/stateAgents/PrivateKeySubscriptionHandler.hxx"using namespace repro;using namespace resip;PrivateKeySubscriptionHandler::PrivateKeySubscriptionHandler(resip::Security& security) : mSecurity(security){}void PrivateKeySubscriptionHandler::onNewSubscription(ServerSubscriptionHandle h, const SipMessage& sub){   if (h->getDocumentKey() != h->getSubscriber())   {      h->send(h->accept(403)); // !jf! is this the correct code?    }   else if (mSecurity.hasUserCert(h->getDocumentKey()))   {      Pkcs8Contents pkcs(mSecurity.getUserPrivateKeyDER(h->getDocumentKey()));      h->send(h->update(&pkcs));   }   else   {      h->reject(404);   }}void PrivateKeySubscriptionHandler::onPublished(ServerSubscriptionHandle associated,                                            ServerPublicationHandle publication,                                            const Contents* contents,                                           const SecurityAttributes* attrs){   associated->send(associated->update(contents));}void PrivateKeySubscriptionHandler::onTerminated(ServerSubscriptionHandle){}void PrivateKeySubscriptionHandler::onError(ServerSubscriptionHandle, const SipMessage& msg){}#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?