/[resiprocate]/main/resip/stack/test/testPksc7.cxx
ViewVC logotype

Annotation of /main/resip/stack/test/testPksc7.cxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5274 - (hide annotations) (download)
Thu Aug 18 23:53:59 2005 UTC (14 years, 3 months ago) by jason
Original Path: branches/b-directory-reorg/resip/sip/test/testPksc7.cxx
File size: 5070 byte(s)
initial reorg - more to come
1 davidb 2437 #include <iostream>
2     #include <memory>
3    
4     #include "resiprocate/Pkcs7Contents.hxx"
5     #include "resiprocate/SipMessage.hxx"
6     #include "resiprocate/test/TestSupport.hxx"
7     #include "resiprocate/os/Logger.hxx"
8    
9     using namespace resip;
10     using namespace std;
11    
12     int
13     main(int argc, char** argv)
14     {
15 derek 2948 Log::initialize(Log::Cout, Log::Debug, argv[0]);
16 davidb 2437
17     {
18     const Data txt("To: <sip:fluffy@h1.cisco1.sipit.net:5060>\r\n"
19     "From: <sip:user@localhost:5080>;tag=2122f945\r\n"
20     "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"
21     "Call-ID: 5e50445050086b2e\r\n"
22     "CSeq: 1 MESSAGE\r\n"
23     "Contact: <sip:user@212.157.205.40:5080>\r\n"
24     "Max-Forwards: 70\r\n"
25     "Content-Disposition: attachment;handling=required;filename=smime.p7\r\n"
26     "Content-Type: application/pkcs7-mime;smime-type=enveloped-data;name=smime.p7m\r\n"
27     "User-Agent: SIPimp.org/0.2.3 (curses)\r\n"
28     "Content-Length: 385\r\n"
29     "\r\n"
30     "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"
31     "82%01%12%02%01%000{0p1%0b0%\r\n"
32     "09%06%03U%04%06%13%02US1%130%11%06%03U%04%08%13%0aCalifornia1%110%0f%06%03U%\r\n"
33     "04%07%13%08San Jose1%0e0%0c\r\n"
34     "%06%03U%04%0a%13%05sipit1)0'%06%03U%04%0b%13 Sipit Test Certificate\r\n"
35     "Authority%02%07U%01%81%02I%00v0%0d%\r\n"
36     "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"
37     "a7%c3%92%b8%0e%10%7f%n%f2%9\r\n"
38     "1(%83%f1n%94%18dS}yi?%11B%cf%d6%00x1%d0jf$%8f%f5%e0l%d3~%b1%1e%e6%db%b7%af%1\r\n"
39     "0w%ca%fc%b9%19%f9r%b6%8a4%f\r\n"
40     "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"
41     "3R%16%c6%15f%baf%e1/P%04Os%\r\n"
42     "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"
43     "6%f7%0d%03%07%04%08%d7%a3%1\r\n"
44     "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"
45     "93%16%f0%cf(%86%d3%10%b6%ff\r\n"
46     "%cf%88G%81W");
47    
48     auto_ptr<SipMessage> msg(TestSupport::makeMessage(txt.c_str()));
49    
50     Pkcs7Contents* pkc = dynamic_cast<Pkcs7Contents*>(msg->getContents());
51     assert(pkc);
52     }
53    
54 dlb 3908 cerr << "All OK" << endl;
55 davidb 2437 return 0;
56     }
57 dlb 3908
58     /* ====================================================================
59     * The Vovida Software License, Version 1.0
60     *
61     * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
62     *
63     * Redistribution and use in source and binary forms, with or without
64     * modification, are permitted provided that the following conditions
65     * are met:
66     *
67     * 1. Redistributions of source code must retain the above copyright
68     * notice, this list of conditions and the following disclaimer.
69     *
70     * 2. Redistributions in binary form must reproduce the above copyright
71     * notice, this list of conditions and the following disclaimer in
72     * the documentation and/or other materials provided with the
73     * distribution.
74     *
75     * 3. The names "VOCAL", "Vovida Open Communication Application Library",
76     * and "Vovida Open Communication Application Library (VOCAL)" must
77     * not be used to endorse or promote products derived from this
78     * software without prior written permission. For written
79     * permission, please contact vocal@vovida.org.
80     *
81     * 4. Products derived from this software may not be called "VOCAL", nor
82     * may "VOCAL" appear in their name, without prior written
83     * permission of Vovida Networks, Inc.
84     *
85     * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
86     * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
87     * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
88     * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
89     * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
90     * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
91     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
92     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
93     * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
94     * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
95     * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
96     * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
97     * DAMAGE.
98     *
99     * ====================================================================
100     *
101     * This software consists of voluntary contributions made by Vovida
102     * Networks, Inc. and many individuals on behalf of Vovida Networks,
103     * Inc. For more information on Vovida Networks, Inc., please see
104     * <http://www.vovida.org/>.
105     *
106     */

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27