00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __CODEX_CIPHERS_POLCREDBASE_H__
00019 #define __CODEX_CIPHERS_POLCREDBASE_H__
00020
00021 #include "RSA.h"
00022 #include "HashFunction.h"
00023
00024 namespace CODEX_Ciphers
00025 {
00031 class PolCredBase : public CODEX_ASN1::Base
00032 {
00033 public :
00035 PolCredBase();
00037 PolCredBase( const RSAPublicKey& publicKey,
00038 const RSASignature& signature );
00051 PolCredBase( const RSAPublicKey& publicKey,
00052 const RSAPrivateKey& signingKey,
00053 const HashFunction& hashFunc );
00055 PolCredBase( const PolCredBase& aCred );
00057 virtual ~PolCredBase() {}
00058
00060 void operator=( const PolCredBase& aCred );
00061
00063 const RSAPublicKey& publicKey() const { return m_publicKey; }
00065 const RSASignature& signature() const { return m_signature; }
00066
00074 bool verify( const RSAPublicKey& delegator,
00075 const HashFunction& hashFunc ) const;
00076
00078 int marshal( unsigned char ** pp ) const;
00080 void* unmarshal( void* bogus, unsigned char ** pp, long length );
00081
00082 private :
00083 static BIGNUM * digest( const RSAPublicKey& publicKey,
00084 const HashFunction& hashFunc );
00085
00086 RSAPublicKey m_publicKey;
00087 RSASignature m_signature;
00088 };
00089 }
00090
00091 #endif