Mixe for Privacy and Anonymity in the Internet
CAPriceInfo.hpp
Go to the documentation of this file.
1 #ifndef __CAPRICEINFO__
2 #define __CAPRICEINFO__
3 /*
4 Copyright (c) 2000, The JAP-Team
5 All rights reserved.
6 Redistribution and use in source and binary forms, with or without modification,
7 are permitted provided that the following conditions are met:
8 
9  - Redistributions of source code must retain the above copyright notice,
10  this list of conditions and the following disclaimer.
11 
12  - Redistributions in binary form must reproduce the above copyright notice,
13  this list of conditions and the following disclaimer in the documentation and/or
14  other materials provided with the distribution.
15 
16  - Neither the name of the University of Technology Dresden, Germany nor the names of its contributors
17  may be used to endorse or promote products derived from this software without specific
18  prior written permission.
19 
20 
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS
22 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
23 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
24 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
26 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
27 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
29 */
30 
39 #ifdef PAYMENT
40 #include "StdAfx.h"
41 class CAPriceInfo
42 {
43 public:
44  CAPriceInfo(UINT8* strMixId, UINT8* strPriceCertHash, SINT32 a_postition);
45 
46  virtual ~CAPriceInfo();
47 
48  UINT8* getMixId()
49  {
50  UINT8* pTmpStr = NULL;
51  if(m_pStrMixId!=NULL)
52  {
53  int hlen = strlen((char*)m_pStrMixId)+1;
54  pTmpStr = new UINT8[hlen];
55  memset(pTmpStr, 0, (hlen*sizeof(UINT8)) );
56  strncpy( (char*)pTmpStr, (char*)m_pStrMixId, (hlen-1));
57  }
58  return pTmpStr;
59  }
60 
61  UINT8* getPriceCertHash()
62  {
63  UINT8* pTmpStr = NULL;
64  if(m_pStrPriceCertHash!=NULL)
65  {
66  int hlen = strlen((char*)m_pStrPriceCertHash)+1;
67  pTmpStr = new UINT8[hlen];
68  memset(pTmpStr, 0, (hlen*sizeof(UINT8)) );
69  strncpy((char*)pTmpStr, (char*)m_pStrPriceCertHash, (hlen-1));
70  }
71  return pTmpStr;
72  }
73 
74  SINT32 getPosition()
75  {
76  return m_postition;
77  }
78 
79 private:
80 
81  UINT8* m_pStrMixId; //SubjectKeyIdentifier of the Mix
82  UINT8* m_pStrPriceCertHash;
83  SINT32 m_postition;
84 };
85 #endif //PAYMENT
86 #endif /*CAPRICEINFO_H_*/
signed int SINT32
Definition: basetypedefs.h:132
unsigned char UINT8
Definition: basetypedefs.h:135