src/algorithm/hmacsha.cpp
/**
			 * Sign jwt data
			 * @param data The data to sign
			 * @return HMAC signature for the given data
			 * @throws signature_generation_exception
			 */
Sign jwt data
@param data The data to sign
@return HMAC signature for the given data
@throws signature_generation_exception
Sign jwt data @param data The data to sign @return HMAC signature for the given data @throws signature_generation_exception
std::string hmacsha::sign(const std::string& data) const 
			{
				std::vector<unsigned char> vec;
				vec.resize(EVP_MAX_MD_SIZE);	
				unsigned int len = static_cast<unsigned int>(vec.size());
					computes the message authentication code of the n 
					bytes at d using the hash function evp_md and the key key which is key_len bytes long.
					unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,	const unsigned char* d, size_t n, unsigned char* md, unsigned int* md_len);
				auto const p = HMAC(
					md_(),		generator
					secret_.data(), 	[key]
					static_cast<int>(secret_.size()), 	[key_len]
					(const unsigned char*)data.data(),		data
					data.size(), 	[n] - byte count
					vec.data(), 	[md] - output
					&len);
				if (p== nullptr)	throw "signature_generation_exception()";
				return std::string(vec.begin(), vec.begin() + len);
			}
std :: string hmacsha :: sign ( const std :: string & data ) const { std :: vector < unsigned char > vec ; vec . resize ( EVP_MAX_MD_SIZE ) ; unsigned int len = static_cast < unsigned int > ( vec . size ( ) ) ; auto const p = HMAC ( md_ ( ) , secret_ . data ( ) , static_cast < int > ( secret_ . size ( ) ) , ( const unsigned char * ) data . data ( ) , data . size ( ) , vec . data ( ) , & len ) ; if ( p == nullptr ) throw " " ; return std :: string ( vec . begin ( ) , vec . begin ( ) + len ) ; }
Sign jwt data
 @param data The data to sign
 @return HMAC signature for the given data
 @throws signature_generation_exception
Sign jwt data @param data The data to sign @return HMAC signature for the given data @throws signature_generation_exception
// 64 // //	computes the message authentication code of the n  //	bytes at d using the hash function evp_md and the key key which is key_len bytes long. //	unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len,	const unsigned char* d, size_t n, unsigned char* md, unsigned int* md_len); // //	generator //	[key] //	[key_len] //	data //	[n] - byte count //	[md] - output