Re: PKCS #7 with Certification Path for a single certificate...

From: Krish Shenoy[MSFT] (kshenoy_at_online.microsoft.com)
Date: 01/26/04


Date: Mon, 26 Jan 2004 13:28:49 -0800

You can either use CAPICOM(easiest but CAPICOM is not available by default
on the OS) or you can use CryptQueryObject with the flags
CERT_QUERY_OBJECT_FILE and CERT_QUERY_CONTENT_FLAG_PKCS7_SIGNED
BOOL WINAPI CryptQueryObject(
  DWORD dwObjectType,
  const void* pvObject,
  DWORD dwExpectedContentTypeFlags,
  DWORD dwExpectedFormatTypeFlags,
  DWORD dwFlags,
  DWORD* pdwMsgAndCertEncodingType,
  DWORD* pdwContentType,
  DWORD* pdwFormatType,
  HCERTSTORE* phCertStore,
  HCRYPTMSG* phMsg,
  const void** ppvContext
);

-- 
Krish Shenoy[MSFT]
This posting is provided "AS IS" with no warranties, and confers no rights.
"Michael Virgil" <anonymous@discussions.microsoft.com> wrote in message
news:10742530-C7D0-414E-B90F-F94A868941DF@microsoft.com...
> Hi,
>
> I'm trying to create a PKCS #7 (in memory BLOB) with a complete
Certification Path for a single certificate. What Crypto API function to
call? I don't see anything like CertSaveStore() for s single certificate
context.
>
> ICertRequest.GetCertificate() looks like what I need, but is only
available on the Windows Server 2003 or Windows 2000 Server. Is there a
Crypto-API client side equivalent?
>
> Has anyone done this? How was it done?
>
> It obviously can be done; IE allows a user to export to a file the PKCS #7
message with a complete certificate path included. I just can't find the
right API.
>
> Thanks,
> Michael
>
>