|
reSIProcate/DialogUsageManager
9694
|
#include "resip/stack/SipStack.hxx"#include "resip/stack/TransactionUser.hxx"#include "resip/stack/ssl/Security.hxx"#include "resip/dum/Handles.hxx"#include "resip/dum/MasterProfile.hxx"#include "resip/dum/UserProfile.hxx"#include "resip/dum/PayloadEncrypter.hxx"#include "resip/dum/DumEncrypted.hxx"#include "resip/stack/PlainContents.hxx"#include "resip/stack/Pkcs7Contents.hxx"#include "resip/stack/MultipartSignedContents.hxx"#include "resip/stack/Mime.hxx"#include "resip/stack/SecurityAttributes.hxx"#include "resip/stack/Helper.hxx"#include "rutil/Log.hxx"#include "rutil/Logger.hxx"#include <iostream>#include <string>#include <sstream>
Go to the source code of this file.
Classes | |
| class | Tu |
Defines | |
| #define | RESIPROCATE_SUBSYSTEM Subsystem::TEST |
Functions | |
| int | main (int argc, char *argv[]) |
| #define RESIPROCATE_SUBSYSTEM Subsystem::TEST |
Definition at line 31 of file testPayloadEncrypter.cxx.
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
Definition at line 95 of file testPayloadEncrypter.cxx.
References resip::Uri::getAor(), InfoLog, and resip::NameAddr::uri().
{
if ( argc < 3 ) {
cout << "usage: " << argv[0] <<"sip:sender sip:recip" << endl;
return 0;
}
Log::initialize(Log::Cout, Log::Debug, argv[0]);
NameAddr senderAor(argv[1]);
NameAddr recipAor(argv[2]);
//Data passwd(argv[3]);
InfoLog(<< "sender: " << senderAor << endl);
InfoLog(<< "recipient: " << recipAor << endl);
#ifdef WIN32
Security* security = new WinSecurity;
#else
Security* security = new Security;
#endif
assert(security);
SipStack stack(security);
Tu tu(security, senderAor.uri().getAor(), recipAor.uri().getAor());
BaseUsageHandle handle;
PayloadEncrypter encrypter(tu, security);
Contents* contents1 = new PlainContents(Data("message signing"));
// sign the message
encrypter.encrypt(std::auto_ptr<Contents>(contents1), senderAor.uri().getAor(), handle);
Contents* contents2 = new PlainContents(Data("message signing and encrypting"));
// sign and encrypt the message
encrypter.encrypt(std::auto_ptr<Contents>(contents2), senderAor.uri().getAor(), recipAor.uri().getAor(), handle);
while (tu.process())
{
}
return 0;
}

1.7.5.1