00001 /* 00002 * Copyright 2003 Michael A. Marsh, Cornell University. All rights reserved. 00003 * This software is released under the modified BSD license. 00004 * See the file LICENSE in the top-level directory for details. 00005 */ 00006 // 00007 // $Id: AugmentedEGPublicKey.h,v 1.3 2005/01/21 19:44:17 mmarsh Exp $ 00008 // 00009 // $Log: AugmentedEGPublicKey.h,v $ 00010 // Revision 1.3 2005/01/21 19:44:17 mmarsh 00011 // Updated for compatibility with Doxygen 1.4.1 00012 // 00013 // Revision 1.2 2004/05/19 15:56:57 mmarsh 00014 // *** empty log message *** 00015 // 00016 // Revision 1.1 2003/11/04 21:56:58 mmarsh 00017 // The ElGamal public key with additional generator, and the signed 00018 // version thereof, are now in the CODEX_Server package rather than 00019 // CODEX_Client, since the generic server should not depend on the 00020 // key service client library. 00021 // 00022 // 00023 00024 #ifndef __CODEX_SERVER_PUBLICKEYMSG_H__ 00025 #define __CODEX_SERVER_PUBLICKEYMSG_H__ 00026 00027 #include "CODEX_Ciphers/ElGamal.h" 00028 #include "CODEX_Ciphers/RSA.h" 00029 00030 namespace CODEX_Server 00031 { 00035 class AugmentedEGPublicKey : public CODEX_ASN1::Base 00036 { 00037 public : 00039 AugmentedEGPublicKey(); 00040 00045 AugmentedEGPublicKey( const CODEX_Ciphers::ElGamalPublicKey& key, 00046 const CODEX_ASN1::BigNumber& h ); 00047 00052 AugmentedEGPublicKey( const AugmentedEGPublicKey& aAPK ); 00053 00055 virtual ~AugmentedEGPublicKey() {} 00056 00058 void operator=( const AugmentedEGPublicKey& aAPK ); 00059 00061 const CODEX_Ciphers::ElGamalPublicKey& key() const { return m_key; } 00063 const CODEX_ASN1::BigNumber& h() const { return m_h; } 00064 00070 BIGNUM* digest( const CODEX_Ciphers::HashFunction& hashFunc ) const; 00071 00073 int marshal( unsigned char ** pp ) const; 00075 void* unmarshal( void* bogus, unsigned char ** pp, long length ); 00076 00077 private : 00078 CODEX_Ciphers::ElGamalPublicKey m_key; 00079 CODEX_ASN1::BigNumber m_h; 00080 }; 00081 00085 class SignedAugmentedEGPublicKey : public CODEX_ASN1::Base 00086 { 00087 public : 00089 SignedAugmentedEGPublicKey(); 00090 00092 SignedAugmentedEGPublicKey( const AugmentedEGPublicKey& aAPK, 00093 const CODEX_Ciphers::RSASignature& sig ); 00094 00099 SignedAugmentedEGPublicKey( 00100 const AugmentedEGPublicKey& aAPK, 00101 const CODEX_Ciphers::RSAPrivateKey& key, 00102 const CODEX_Ciphers::HashFunction& hashFunc ); 00103 00105 SignedAugmentedEGPublicKey( 00106 const SignedAugmentedEGPublicKey& aOther ); 00107 00109 virtual ~SignedAugmentedEGPublicKey() {} 00110 00112 void operator=( const SignedAugmentedEGPublicKey& aOther ); 00113 00115 const AugmentedEGPublicKey& key() const { return m_key; } 00116 00118 const CODEX_Ciphers::RSASignature& signature() const 00119 { 00120 return m_signature; 00121 } 00122 00130 bool verify( const CODEX_Ciphers::RSAPublicKey& key, 00131 const CODEX_Ciphers::HashFunction& hashFunc ) const; 00132 00134 int marshal( unsigned char ** pp ) const; 00136 void* unmarshal( void* bogus, unsigned char ** pp, long length ); 00137 00138 private : 00139 AugmentedEGPublicKey m_key; 00140 CODEX_Ciphers::RSASignature m_signature; 00141 }; 00142 00143 } 00144 00145 #endif /* __CODEX_SERVER_PUBLICKEYMSG_H__ */
1.4.1