PKCS#7 and Sun's MS CAPI Provider (JDK 1.6)
843811Oct 2 2007 — edited Nov 25 2009I wrote an applet that uses CMS and the CMSSignedDataGenerator to
create PCKS7-compliant signatures for some messaging infrastructure
that on the server must be compatible with CAPICOM attached signature of microsoft.
Then, I decided to make my life a bit more complicated (hoping that I
was making my client's life easier). Instead of loading my key
material from a standard Java JKS keystore, I decided to use Sun's new
MSCAPI provider that's part of Java 6 so that my client could use
familiar Microsoft screens to manage key material in the Windows
environment.
Unfortunately, the signing code I wrote started to barf. I've poked
into the code, and the ultimate problem appears to be that the MSCAPI
provider's implementation of RSAPrivateKey
(sun.security.mscapi.RSAPrivateKey) doesn't implement the
java.security.interfaces.RSAPrivateKey interface.
Can someone help me?