📄 privatekeysubscriptionhandler.cxx
字号:
#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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -