B
Bhavesh.Feb
Hi,
I'm trying to use SHA1 and HMAC to create signature for my web
service request. I dont know much about HMAC or SHA1 but this is what i
need to create signature. What i'm trying to do is:
SHA_CTX shaContext;
SHA1_Init(&shaContext);
SHA1_Update(&shaContext, &data, dataLen );
SHA1_Final(cipher_key, &shaContext);
char out[EVP_MAX_MD_SIZE]; // EVP_MAX_MD_SIZE is the limit on
int len; // what HMAC will ever put in out
HMAC(
sha1(),
secretKey,
strlen(secretKey),
data.c_str(),
dataLen,
out,
&len
);
It's throwing some compilation error for call to HMAC as i'm not
passing correct parameter to it.
Does someone already implemented this???? Can someone share working
code snippet?
Thanks,
Bhavesh
I'm trying to use SHA1 and HMAC to create signature for my web
service request. I dont know much about HMAC or SHA1 but this is what i
need to create signature. What i'm trying to do is:
SHA_CTX shaContext;
SHA1_Init(&shaContext);
SHA1_Update(&shaContext, &data, dataLen );
SHA1_Final(cipher_key, &shaContext);
char out[EVP_MAX_MD_SIZE]; // EVP_MAX_MD_SIZE is the limit on
int len; // what HMAC will ever put in out
HMAC(
sha1(),
secretKey,
strlen(secretKey),
data.c_str(),
dataLen,
out,
&len
);
It's throwing some compilation error for call to HMAC as i'm not
passing correct parameter to it.
Does someone already implemented this???? Can someone share working
code snippet?
Thanks,
Bhavesh