<div dir="ltr"><div><div><div><div><div><div><div><div>Hello,<br><br></div>regarding the Bug <a href="https://bugs.openjdk.java.net/browse/JDK-8133634">https://bugs.openjdk.java.net/browse/JDK-8133634</a> (assigned to Vincent) I can help.<br><br>When importing the P12 container on a recent Windows it gets by default imported under a CSP provider from the CNG API and not in CAPI legacy store:<br><br></div><div>Import CLI or certmgr.msc (exportable or not):<br><br></div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">certutil.exe -user -f -v -importpfx "ACA PF Administrativo Activo.p12"<br></blockquote><br>Consequently it does not show up as having a key in the Windows KeyStore implementation:<br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> keytool -list -storetype Windows-MY<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">...<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">EA=<a href="mailto:demo.empleado@cgae.redabogacia.org">demo.empleado@cgae.redabogacia.org</a>, .... trustedCertEntry,<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Zertifikat-Fingerprint (SHA1): 89:69:78:75:52:6A:DB:01:9B:95:42:63:19:E3:00:9E:60:5E:1D:EF<br></blockquote></div><div><br><br></div>You can verify the cryptographic provider used with the Windows tool:<br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">certutil.exe -store -user my<br></blockquote><br></div>It will list the certificate and mention "Microsoft Base Crytographic Provider 1.0"<br><br></div>If the P12 is deleted and re-imported with the following command the key will show up in the legacy keystore:<br><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">$ certutil -csp “Microsoft Strong Cryptographic Provider” -user -f -v -importpfx "ACA PF Administrativo Activo.p12"<br>... </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Das Zertifikat "EA=<a href="mailto:demo.empleado@cgae.redabogacia.org">demo.empleado@cgae.redabogacia.org</a>, ..." wurde zum Speicher hinzugefügt.<br></blockquote><br></div><div><br>Again certutil shows us the (better) provider:<br><br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">CertUtil.exe -store -user my<br>my "Eigene Zertifikate"<br>================ Zertifikat 0 ================<br>Seriennummer: 659d357f6f05af385114e692393b5bb0<br>Aussteller: CN=ACA... </blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Antragsteller: E=<a href="mailto:demo.empleado@cgae.redabogacia.org">demo.empleado@cgae.redabogacia.org</a>, ..<br></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Kein Stammzertifikat<br>Zertifikathash(sha1): 89 69 78 75 52 6a db 01 9b 95 42 63 19 e3 00 9e 60 5e 1d ef<br>  Schlüsselcontainer = {0F1CB13E-CA6C-46D0-9C74-25F7B3C780D9}<br>  Eindeutiger Containername: 512a12f4d213aef6c4cadf5a5efc19cf_74be6a0b-923e-4199-a6c6-b2089f1643c4<br>  Anbieter = Microsoft Base Cryptographic Provider v1.0<br></blockquote><br></div>And consequently keytool will list it as a key:<br><br></div><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> keytool -list -storetype Windows-MY<br>...<br>EA=<a href="mailto:demo.empleado@cgae.redabogacia.org">demo.empleado@cgae.redabogacia.org</a>, CN=NOMBRE..., PrivateKeyEntry,<br>...<br></blockquote><div><br></div><div>It is very unfortunate that SunMSCAPI provider uses the old CAPI and not the CNG versions, because the new versions benefit for example from a Commons Criteria certification where the key material in stored in the priveledged KeyIso service, unreachable by the application. (And I guess it would solve a few of the problems with alternative sign formats, with unavailable smartcard stubs etc.<br><br></div><div>So any idea if we see CNG support any time soon, it is available since Vista.<br></div><div><br></div><div>Gruss<br></div><div>Bernd<br><br></div><div>PS: can somebody extend the JIRA with my research (attribution welcome).<br></div><div> </div></div>