Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
platform
active.directory
adsi
adsi.iis-admin
base
com_ole
complus_mts
component_svcs
database
directx
gdi
graphics_mm
internet.client
internet.server
internet.server.isapi-dev
localization
mapi
messaging
msi
mslayerforunicode
multimedia
networking
networking.ipv6
sdk_install
security
shell
telephony.tapi_2
telephony.tapi_3
telephony.tsp
telephony.wte
tools
ui
ui_shell
win_base_svcs
win16
  
 
date: Fri, 1 Aug 2008 23:19:05 -0700 (PDT),    group: microsoft.public.platformsdk.security        back       


Provider's public key is invalid   
I'm try to sign a file using smart card.
I'm using visual studio 2008

 public static byte[] SignMsg(Byte[] msg, X509Certificate2 signerCert,
bool detached)
       {
           //  Place message in a ContentInfo object.
           //  This is required to build a SignedCms object.
           ContentInfo contentInfo = new ContentInfo(msg);

           //  Instantiate SignedCms object with the ContentInfo
above.
           //  Has default SubjectIdentifierType
IssuerAndSerialNumber.
           SignedCms signedCms = new SignedCms(contentInfo,
detached);

           //  Formulate a CmsSigner object for the signer.
           CmsSigner cmsSigner = new CmsSigner(signerCert);

           // Include the following line if the top certificate in
the
           // smartcard is not in the trusted list.
           cmsSigner.IncludeOption = X509IncludeOption.EndCertOnly;

           //  Sign the CMS/PKCS #7 message. The second argument is
           //  needed to ask for the pin.
           signedCms.ComputeSignature(cmsSigner, false);

           //  Encode the CMS/PKCS #7 message.
           return signedCms.Encode();
       }


I have installed the certificate in the storage, when i encrypt it ask
the pin and sign succesfully.

In windows 2003 with the same smart card and different readers i'm be
able succesfully to sign a file and produce a pm7 sucessfully, or sign
a PDF.

The same code with same card throw "Provider's public key is invalid"
exception in vista, i've tryed 3 different pc with vista and different
smart card, with 2003 works fine in vista no.

I'm trying to investigate ACL in certificate store but unsuccesfully.


TIA
Andrea Del Brocco
date: Fri, 1 Aug 2008 23:19:05 -0700 (PDT)   author:   Del Brocco Andrea

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us