Re: Signing binary data with CAPICOM
From: Shawn Corey [MSFT] (shawncor_at_online.microsoft.com)
Date: 10/12/04
- Next message: Shawn Corey [MSFT]: "Re: Certificates: Which store to add to?"
- Previous message: Craig: "Re: Cert Stores"
- In reply to: Bill Brice: "Signing binary data with CAPICOM"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Mon, 11 Oct 2004 19:32:50 -0700
You can place binary data in to the BSTR you are passing to CAPICOM. There
is also no problem with odd length strings, BSTRs do not have to be unicode
and CAPICOM treats all BSTRs passed into it as an array of bytes internally.
The only thing to watch out for is if you are using managed code, the
framework marshalls all BSTRs as Unicode so there can be problems with
compatability between managed and unmanaged because extra bytes may be added
in the managed code.
-- Thanks, Shawn This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm "Bill Brice" <BillBrice@discussions.microsoft.com> wrote in message news:9063FA8C-2ED0-4468-BF03-B699B5583BC4@microsoft.com... > CAPICOM expects data to-be-signed to be stored in a BSTR in the > SignedData.Content property. By definition this is a Unicode string. If > you > have binary data, it is possible to load it into a byte array and assign > the > byte array to a string and then to SignedData.Content. What if the binary > data is an odd number of bytes in length? Does CAPICOM handle this > properly, > or does it always assume an even number of bytes, since the Content > property > is a BSTR? Please clarify and also identify any other issues with signing > binary data using CAPICOM. Thanks. > -- > Bill Brice
- Next message: Shawn Corey [MSFT]: "Re: Certificates: Which store to add to?"
- Previous message: Craig: "Re: Cert Stores"
- In reply to: Bill Brice: "Signing binary data with CAPICOM"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|