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: PolCredBase.h,v 1.4 2005/01/21 19:44:16 mmarsh Exp $ 00008 // 00009 // $Log: PolCredBase.h,v $ 00010 // Revision 1.4 2005/01/21 19:44:16 mmarsh 00011 // Updated for compatibility with Doxygen 1.4.1 00012 // 00013 // Revision 1.3 2004/05/19 15:56:47 mmarsh 00014 // *** empty log message *** 00015 // 00016 // Revision 1.2 2003/11/04 22:31:47 mmarsh 00017 // *** empty log message *** 00018 // 00019 // 00020 00021 #ifndef __CODEX_CIPHERS_POLCREDBASE_H__ 00022 #define __CODEX_CIPHERS_POLCREDBASE_H__ 00023 00024 #include "RSA.h" 00025 #include "HashFunction.h" 00026 00027 namespace CODEX_Ciphers 00028 { 00034 class PolCredBase : public CODEX_ASN1::Base 00035 { 00036 public : 00038 PolCredBase(); 00040 PolCredBase( const RSAPublicKey& publicKey, 00041 const RSASignature& signature ); 00054 PolCredBase( const RSAPublicKey& publicKey, 00055 const RSAPrivateKey& signingKey, 00056 const HashFunction& hashFunc ); 00058 PolCredBase( const PolCredBase& aCred ); 00060 virtual ~PolCredBase() {} 00061 00063 void operator=( const PolCredBase& aCred ); 00064 00066 const RSAPublicKey& publicKey() const { return m_publicKey; } 00068 const RSASignature& signature() const { return m_signature; } 00069 00077 bool verify( const RSAPublicKey& delegator, 00078 const HashFunction& hashFunc ) const; 00079 00081 int marshal( unsigned char ** pp ) const; 00083 void* unmarshal( void* bogus, unsigned char ** pp, long length ); 00084 00085 private : 00086 static BIGNUM * digest( const RSAPublicKey& publicKey, 00087 const HashFunction& hashFunc ); 00088 00089 RSAPublicKey m_publicKey; 00090 RSASignature m_signature; 00091 }; 00092 } 00093 00094 #endif /* __CODEX_CIPHERS_POLCREDBASE_H__ */
1.4.1