// DWBS ------------------------------------------------------------------ DWBS
//
// PLATFORM		: ALL
// PRODUCT		: BIT_DEMON
// VISIBILITY	: PUBLIC
//
// DWBS ------------------------------------------------------------------ DWBS

// PURPOSE: Wrapper around key exchange functionality.

#ifndef BD_ECCKEY_H
#define BD_ECCKEY_H

#include <bdCore/bdMemory/bdMemory.h>
#include <bdCore/bdCrypto/bdCryptoConfig.h>

class bdECCKey
{
	public:

		BD_DECLARE_NEW_AND_DELETE_OPERATORS

 		/// Default constructor
		bdECCKey();

		/// Virtual destructor
		~bdECCKey();

		bdBool create();

		bdBool importKey(const bdUByte8 *const pubKey,
						 bdUInt keylen);

		bdBool generateSecret(bdECCKey &other,
							  bdUByte8 secret[BD_ECC_SHARED_SECRET_SIZE]);

		bdBool exportKey(bdUByte8 *pubKey,
						 bdUInt &keylen);

	protected:

		bdBool m_madeKey;
		ecc_key m_key;
};



#endif // BD_ECCKEY_H

