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.2 2004/05/19 15:56:57 mmarsh Exp $ 00008 // 00009 // $Log: AugmentedEGPublicKey.h,v $ 00010 // Revision 1.2 2004/05/19 15:56:57 mmarsh 00011 // *** empty log message *** 00012 // 00013 // Revision 1.1 2003/11/04 21:56:58 mmarsh 00014 // The ElGamal public key with additional generator, and the signed 00015 // version thereof, are now in the CODEX_Server package rather than 00016 // CODEX_Client, since the generic server should not depend on the 00017 // key service client library. 00018 // 00019 // 00020 00021 #ifndef __CODEX_SERVER_PUBLICKEYMSG_H__ 00022 #define __CODEX_SERVER_PUBLICKEYMSG_H__ 00023 00024 #include "CODEX_Ciphers/ElGamal.h" 00025 #include "CODEX_Ciphers/RSA.h" 00026 00027 namespace CODEX_Server 00028 { 00032 class AugmentedEGPublicKey : public CODEX_ASN1::Base 00033 { 00034 public : 00036 AugmentedEGPublicKey(); 00037 00042 AugmentedEGPublicKey( const CODEX_Ciphers::ElGamalPublicKey& key, 00043 const CODEX_ASN1::BigNumber& h ); 00044 00049 AugmentedEGPublicKey( const AugmentedEGPublicKey& aAPK ); 00050 00052 virtual ~AugmentedEGPublicKey() {} 00053 00055 void operator=( const AugmentedEGPublicKey& aAPK ); 00056 00058 const CODEX_Ciphers::ElGamalPublicKey& key() const { return m_key; } 00060 const CODEX_ASN1::BigNumber& h() const { return m_h; } 00061 00067 BIGNUM* digest( const CODEX_Ciphers::HashFunction& hashFunc ) const; 00068 00070 int marshal( unsigned char ** pp ) const; 00072 void* unmarshal( void* bogus, unsigned char ** pp, long length ); 00073 00074 private : 00075 CODEX_Ciphers::ElGamalPublicKey m_key; 00076 CODEX_ASN1::BigNumber m_h; 00077 }; 00078 00082 class SignedAugmentedEGPublicKey : public CODEX_ASN1::Base 00083 { 00084 public : 00086 SignedAugmentedEGPublicKey(); 00087 00089 SignedAugmentedEGPublicKey( const AugmentedEGPublicKey& aAPK, 00090 const CODEX_Ciphers::RSASignature& sig ); 00091 00096 SignedAugmentedEGPublicKey( 00097 const AugmentedEGPublicKey& aAPK, 00098 const CODEX_Ciphers::RSAPrivateKey& key, 00099 const CODEX_Ciphers::HashFunction& hashFunc ); 00100 00102 SignedAugmentedEGPublicKey( 00103 const SignedAugmentedEGPublicKey& aOther ); 00104 00106 virtual ~SignedAugmentedEGPublicKey() {} 00107 00109 void operator=( const SignedAugmentedEGPublicKey& aOther ); 00110 00112 const AugmentedEGPublicKey& key() const { return m_key; } 00113 00115 const CODEX_Ciphers::RSASignature& signature() const 00116 { 00117 return m_signature; 00118 } 00119 00127 bool verify( const CODEX_Ciphers::RSAPublicKey& key, 00128 const CODEX_Ciphers::HashFunction& hashFunc ) const; 00129 00131 int marshal( unsigned char ** pp ) const; 00133 void* unmarshal( void* bogus, unsigned char ** pp, long length ); 00134 00135 private : 00136 AugmentedEGPublicKey m_key; 00137 CODEX_Ciphers::RSASignature m_signature; 00138 }; 00139 00140 } 00141 00142 #endif /* __CODEX_SERVER_PUBLICKEYMSG_H__ */
1.2.18