reSIProcate/stack  9694
Functions
testPksc7.cxx File Reference
#include <iostream>
#include <memory>
#include "resip/stack/Pkcs7Contents.hxx"
#include "resip/stack/SipMessage.hxx"
#include "resip/stack/test/TestSupport.hxx"
#include "rutil/Logger.hxx"
Include dependency graph for testPksc7.cxx:

Go to the source code of this file.

Functions

int main (int argc, char **argv)

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 13 of file testPksc7.cxx.

References resip::Data::c_str(), resip::Log::Cout, resip::Log::Debug, resip::Log::initialize(), and resip::TestSupport::makeMessage().

{
   Log::initialize(Log::Cout, Log::Debug, argv[0]);

   {
      const Data txt("To: <sip:fluffy@h1.cisco1.sipit.net:5060>\r\n"
                     "From: <sip:user@localhost:5080>;tag=2122f945\r\n"
                     "Via: SIP/2.0/UDP 212.157.205.40:5080;branch=z9hG4bK-c87542-472657511-2--c87542-;rport=5080;received=212.157.205.40\r\n"
                     "Call-ID: 5e50445050086b2e\r\n"
                     "CSeq: 1 MESSAGE\r\n"
                     "Contact: <sip:user@212.157.205.40:5080>\r\n"
                     "Max-Forwards: 70\r\n"
                     "Content-Disposition: attachment;handling=required;filename=smime.p7\r\n"
                     "Content-Type: application/pkcs7-mime;smime-type=enveloped-data;name=smime.p7m\r\n"
                     "User-Agent: SIPimp.org/0.2.3 (curses)\r\n"
                     "Content-Length: 385\r\n"
                     "\r\n"
                     "0%82%01}%06%09*%86H%86%f7%0d%01%07%03%a0%82%01n0%82%01j%02%01%001%82%01%160%\r\n"
                     "82%01%12%02%01%000{0p1%0b0%\r\n"
                     "09%06%03U%04%06%13%02US1%130%11%06%03U%04%08%13%0aCalifornia1%110%0f%06%03U%\r\n"
                     "04%07%13%08San Jose1%0e0%0c\r\n"
                     "%06%03U%04%0a%13%05sipit1)0'%06%03U%04%0b%13 Sipit Test Certificate\r\n"
                     "Authority%02%07U%01%81%02I%00v0%0d%\r\n"
                     "06%09*%86H%86%f7%0d%01%01%01%05%00%04%81%80%80nYR%ba%a1%14%9eV%1c%9b<%f3%80%\r\n"
                     "a7%c3%92%b8%0e%10%7f%n%f2%9\r\n"
                     "1(%83%f1n%94%18dS}yi?%11B%cf%d6%00x1%d0jf$%8f%f5%e0l%d3~%b1%1e%e6%db%b7%af%1\r\n"
                     "0w%ca%fc%b9%19%f9r%b6%8a4%f\r\n"
                     "0%d1,t%83%de+%b0%1f%8b%05'%c6%af%c5%dc9%1d%cb%9f7!%08%15%d2A%0b%f2y\"%03%84%e\r\n"
                     "3R%16%c6%15f%baf%e1/P%04Os%\r\n"
                     "90%ea%e9%a1%a8H1%a2%ad%99%a70K%06%09*%86H%86%f7%0d%01%07%010%14%06%08*%86H%8\r\n"
                     "6%f7%0d%03%07%04%08%d7%a3%1\r\n"
                     "4%02%8fO\"%ef%80(%d1_%05%9e%118@%87%b0%a4%87%e45%e4[1%8b%e6%d2%b2%e4%d3.%08%\r\n"
                     "93%16%f0%cf(%86%d3%10%b6%ff\r\n"
                     "%cf%88G%81W");

      auto_ptr<SipMessage> msg(TestSupport::makeMessage(txt.c_str()));

      Pkcs7Contents* pkc = dynamic_cast<Pkcs7Contents*>(msg->getContents());
      assert(pkc);
   }

   cerr << "All OK" << endl;
   return 0;
}

Here is the call graph for this function: