Re: computing hash from a pkcs7 signature

From: Michel Gallant (neutron_at_istar.ca)
Date: 06/30/05


Date: Thu, 30 Jun 2005 09:31:59 -0400

Send me a copy of a signed message blob you are using.
 - Mitch

"Param" <Param@discussions.microsoft.com> wrote in message news:FB8A92CD-A333-465A-8F34-4400C8537144@microsoft.com...
> 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
> >
> >
> >