Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing MS CryptoAPI with java

I was trying to make good use of the MS CAPI, and stumped into a great mischief... The SunMSCapi provider only, hmm, provides, per lack of better word, at least for signature, the following algorithms:

  • MD2withRSA
  • MD5withRSA
  • SHA1withRSA

And I am not eager to make use of algorithms such GOST3411withECGOST3410, or RIPEMD128withRSA, that BouncyCastle makes use, but it would be nice, and in this particular case, quite important if not essential, to be able to sign in, at least, the SHA256withRSA algorithm... (the 512 and so on and ECDSA encryption, would be a big plus, but i don't expect that much).

I am trying to find an alternative, but only found this wrapper, which looks fine, but I have to dig it a little more.

Does anyone knows another way, wrapper or provider to access mscapi (cryptoapi)?


Related:

  • SunMSCapi doc:
    http://docs.oracle.com/javase/6/docs/technotes/guides/security/SunProviders.html#SunMSCAPI

  • Request for SHA256withRSA:
    http://bugs.sun.com/view_bug.do?bug_id=6753664

like image 257
marcelo-ferraz Avatar asked Apr 25 '12 14:04

marcelo-ferraz


2 Answers

Take a look at RSA bsafe share which supports RSA with SHA-256.

like image 90
pd40 Avatar answered Nov 17 '22 06:11

pd40


Java is cross platform, if you choose SunMSCapi, you can only run on windows with JDK 6+, and if want SHA256withRSA, you need run on JDK7+, it is there. check code RSASignature.SHA256

like image 1
Ted Shaw Avatar answered Nov 17 '22 07:11

Ted Shaw