question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to sign with Yubikey on Windows

See original GitHub issue

Hi. I have Windows 10, Yubikey 4 FIPS with SSL.com code signing certificate installed. Yubico-piv-tool is also installed, but I still get error:

c:\build\sign>"c:\Program Files\Java\jre1.8.0_341\bin\java.exe" -Djava.security.debug=sunpkcs11 -jar jsign-4.1.jar --storetype=YUBIKEY test.exe
jsign: Couldn't sign test.exe
java.security.ProviderException: java.io.IOException: The specified module could not be found.
C:\Program Files\Yubico\Yubico PIV Tool\bin\libykcs11.dll
        at net.jsign.YubiKey.getSunPKCS11Configuration(YubiKey.java:65)
        at net.jsign.YubiKey.getProvider(YubiKey.java:44)
        at net.jsign.SignerHelper.build(SignerHelper.java:361)
        at net.jsign.SignerHelper.sign(SignerHelper.java:562)
        at net.jsign.JsignCLI.execute(JsignCLI.java:117)
        at net.jsign.JsignCLI.main(JsignCLI.java:40)
Caused by: java.io.IOException: The specified module could not be found.
C:\Program Files\Yubico\Yubico PIV Tool\bin\libykcs11.dll
        at sun.security.pkcs11.wrapper.PKCS11.connect(Native Method)
        at sun.security.pkcs11.wrapper.PKCS11.<init>(PKCS11.java:144)
        at sun.security.pkcs11.wrapper.PKCS11$SynchronizedPKCS11.<init>(PKCS11.java:1583)
        at sun.security.pkcs11.wrapper.PKCS11.getInstance(PKCS11.java:159)
        at net.jsign.YubiKey.getTokenSlot(YubiKey.java:76)
        at net.jsign.YubiKey.getSunPKCS11Configuration(YubiKey.java:60)
        ... 5 more
Try `java -jar jsign.jar --help' for more information.

I’ve tried a lot, including @ebourg recommendations from https://github.com/ebourg/jsign/issues/122 Can anyone help? Thanks.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ebourgcommented, Sep 20, 2022

Good! I think Jsign could be improved to automatically select the X.509 Certificate for PIV Authentication if it’s the only one available (this seems to be the case when certification authorities deliver an EV certificate on a Yubikey). For now it only looks for X.509 Certificate for Digital Signature by default, and at some point, before setting the java.security.debug property, you should have gotten this error message indicating that the alias was wrong:

No certificate found under the alias 'X.509 Certificate for Digital Signature' in the keystore SunPKCS11-yubikey
(available aliases: X.509 Certificate for PIV Attestation, X.509 Certificate for PIV Authentication)
0reactions
rearden-steelcommented, Sep 20, 2022

Strange but it works 🤷‍♂️ 😆

Read more comments on GitHub >

github_iconTop Results From Across the Web

Yubico Login for Windows Configuration Guide
Able to log in using sign-in options other than Yubico Login after provisioning. Windows sign-in options beginning with Windows Hello (e.g. ...
Read more >
Can't sign in to Windows with YubiKey - Reddit
Can't sign in to Windows with YubiKey. I just started using a YubiKey and I have added it to my Windows Account Sign-in...
Read more >
Using YubiKey with Windows 10
To uninstall the YubiKey for Windows Hello App. Be sure you have unregistered any YubiKeys before you uninstall the app. In the Start...
Read more >
How to setup YubiKey with Windows Hello?
I'm trying to setup my Windows PC to be able to sign in With a YubiKey, and need help to use it to...
Read more >
Go Passwordless with Microsoft Accounts & YubiKey - YouTube
Use security keys and Pin instead of passwords to access your Microsoft accounts for easy access to Outlook, Microsoft Office and other ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found