JDK-8068797 : Ability to pass CRYPT_ACQUIRE_SILENT_FLAG in CryptAcquireCertificatePrivateKey
  • Type: Enhancement
  • Component: security-libs
  • Sub-Component: java.security
  • Affected Version: 8u25
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_7
  • CPU: generic
  • Submitted: 2015-01-12
  • Updated: 2016-10-21
  • Resolved: 2016-10-21
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
We have a Java application which aims to generate digital signatures on 
documents and transactions.  The process for generating this signature is by 
using our CSP MiniDriver for Windows 7.  The problem is that at some point 
these applications use calls to read from the Windows certificate repository 
(using KeyStore.getInstance ("Windows-MY")). 
For each certificate found, even if it is not necessary for the operation, 
the application displays a popup stating that the item found is not required 
for operation. 

Assuming you have 5 or more certificates in the repository, and the read 
operation is executed multiple times, and many popups are displayed, which 
disrupts the operation.  According to what was found, the access to the 
Windows repository is done by the sunmscapi.dll library, which is installed 
as part of the JRE. 
This DLL sometimes would call the CryptAcquireCertificatePrivateKey() 
function and this function would be displaying the popup. 
Is there any way, from the Java application to hide the appearance of this 
popup? 

Could, for instance, the function be passed the CRYPT_ACQUIRE_SILENT_FLAG 
flag? 
Comments
The main goal of that request was to reduce the number of popup dialog windows when accessing the keystore on a smartcard. This goal was achieved by fixing JDK-8153438, so closing this issue as a duplicate of later.
21-10-2016