|
Mixe for Privacy and Anonymity in the Internet
|
00001 /* 00002 Copyright (c) 2000, The JAP-Team 00003 All rights reserved. 00004 Redistribution and use in source and binary forms, with or without modification, 00005 are permitted provided that the following conditions are met: 00006 00007 - Redistributions of source code must retain the above copyright notice, 00008 this list of conditions and the following disclaimer. 00009 00010 - Redistributions in binary form must reproduce the above copyright notice, 00011 this list of conditions and the following disclaimer in the documentation and/or 00012 other materials provided with the distribution. 00013 00014 - Neither the name of the University of Technology Dresden, Germany nor the names of its contributors 00015 may be used to endorse or promote products derived from this software without specific 00016 prior written permission. 00017 00018 00019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS 00020 OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 00021 AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS 00022 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00023 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 00024 OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 00025 IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00026 OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 00027 */ 00028 /* 00029 * CAMultiSignature.hpp 00030 * 00031 * Created on: 17.07.2008 00032 * Author: zenoxx 00033 */ 00034 00035 #ifndef CAMULTISIGNATURE_HPP_ 00036 #define CAMULTISIGNATURE_HPP_ 00037 00038 #include "CACertStore.hpp" 00039 #include "CACertificate.hpp" 00040 00041 struct __t_signature 00042 { 00043 CASignature* pSig; 00044 CACertStore* pCerts; 00045 UINT8* pSKI; 00046 struct __t_signature* next; 00047 }; 00048 typedef struct __t_signature SIGNATURE; 00049 00050 class CAMultiSignature 00051 { 00052 public: 00053 CAMultiSignature(); 00054 virtual ~CAMultiSignature(); 00055 SINT32 addSignature(CASignature* a_signature, CACertStore* a_certs, UINT8* a_ski, UINT32 a_skiLen); 00056 SINT32 signXML(DOMNode* a_node, bool appendCerts); 00057 SINT32 signXML(UINT8* in, UINT32 inlen, UINT8* out, UINT32* outlen, bool appendCerts); 00058 static SINT32 verifyXML(const UINT8* const in, UINT32 inlen, CACertificate* a_cert); 00059 static SINT32 verifyXML(DOMNode* a_node, CACertificate* a_cert); 00060 UINT32 getSignatureCount(){ return m_sigCount; } 00061 SINT32 sign(UINT8* in,UINT32 inlen,UINT8* sig,UINT32* siglen); 00062 SINT32 getXORofSKIs(UINT8* out, UINT32 outlen); 00063 SINT32 findSKI(const UINT8* a_strSKI); 00064 private: 00065 SIGNATURE* m_signatures; 00066 UINT32 m_sigCount; 00067 UINT8* m_xoredID; 00068 SINT32 getSKI(UINT8* in, UINT32 inlen, const UINT8* a_ski); 00069 }; 00070 00071 #endif /* CAMULTISIGNATURE_HPP_ */
1.7.6.1