Il popup viene attivato dalla MS-CAPI Cryptographic Service Provider (CSP) - la DLL fornito dal USB produttore Token - che alla fine comunica al token attraverso un driver (fornito anche dal token-produttore). KeyStore effettua semplicemente una chiamata e gli strati in mezzo passano semplicemente attraverso; il firmware sul token è quella che solleva l'autenticazione pop-up e mantiene dello stato sessione, ecc
La dll chiave Java è sunmscapi.dll che ha l'attuazione:
// Use CertEnumCertificatesInStore to get the certificates
// from the open store. pCertContext must be reset to
// NULL to retrieve the first certificate in the store.
while (pCertContext = ::CertEnumCertificatesInStore(hCertStore, pCertContext))
{
// Check if private key available - client authentication certificate
// must have private key available.
HCRYPTPROV hCryptProv = NULL;
DWORD dwKeySpec = 0;
HCRYPTKEY hUserKey = NULL;
BOOL bCallerFreeProv = FALSE;
BOOL bHasNoPrivateKey = FALSE;
DWORD dwPublicKeyLength = 0;
if (::CryptAcquireCertificatePrivateKey(pCertContext, NULL, NULL,
&hCryptProv, &dwKeySpec, &bCallerFreeProv) == FALSE)
{
bHasNoPrivateKey = TRUE;
} else {
// Private key is available
BOOL bGetUserKey = ::CryptGetUserKey(hCryptProv, dwKeySpec, &hUserKey);
// Skip certificate if cannot find private key
if (bGetUserKey == FALSE)
{
if (bCallerFreeProv)
::CryptReleaseContext(hCryptProv, NULL);
continue;
}
....
Come si può vederlo controlla sempre una chiave privata. Dovresti modificare questo codice e creare una versione personalizzata di sunmscapi.dll per evitare questo o altrimenti sconfiggere questo controllo.
fonte
2012-10-31 19:56:12
Questa domanda non riceve molta attenzione, forse chiedi anche ai forum Oracle (link a questa domanda). –