Closed zzambers closed 1 year ago
weird. Do you know how to generate key pair for it?
Well, I don't think it is currently possible to create compatible EC key from java. CSignature class from SunMSCAPI requires EC key to be instance of CPrivateKey. That in turn is some kind of handle to native key in MS API. There is no KeyPairGenerator for EC and SunMSCAPI does not implement KeyFactory to convert from java-side keys.
I think it could be possible to sign with EC keys present in Windows keystore, if put there by other means. I see no way create them from java.
fair enough., ty!
Problem: SunMSCAPI provider does not have KeyPairGenerators for EC keys [1] (and does not accept keys generated by generators from other providers).
Fix: Ignore Signature algorithms, where we don't have generators.
[1] https://github.com/openjdk/jdk/blob/master/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/CKeyPairGenerator.java