Re: computing hash from a pkcs7 signature

From: Param (Param_at_discussions.microsoft.com)
Date: 06/30/05


Date: Wed, 29 Jun 2005 22:08:01 -0700

thanx for ur reply,
here is the code snippet.

1)hMsg = CryptMsgOpenToDecode(MY_ENCODING_TYPE,0,0,0,NULL,NULL);

2)if(!(CryptMsgUpdate(hMsg,pbData,cbData,TRUE)))
{

}
3)if(!(CryptMsgGetParam(hMsg,CMSG_HASH_DATA_PARAM,0,NULL,&cbHash)))
{

}

4)if(!(CryptMsgGetParam(hMsg,CMSG_HASH_DATA_PARAM,0,pbHash,&cbHash)))
{

}

in step 3 i am getting CRYPT_E_INVALID_MSG_TYPE error.
but this message is pkcs7 signed message and also i am able to verify the
signature using other tools.Is there any wrong in this?
thanx

"Michel Gallant" wrote:

> CMSG_HASH_DATA_PARAM.
> Don't forget that this hash value will include both the content signed, as well
> as any authenticated attributes, if present.
> - Mitch Gallant
>
> "Param" <Param@discussions.microsoft.com> wrote in message news:1A6A06B0-0021-440A-8E34-277B8E92A604@microsoft.com...
> > Hi,
> > How to get the hash from a pkcs7 signature.
> > Is there any CryptoAPI for this.
> > What about the CryptMsgGetParam()?
> > If this is the correct API , then what I have to pass dwParamType?
> > Thanx in advance
>
>
>