Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public key export doesn't work #12

Closed
hvge opened this issue Sep 11, 2018 · 0 comments
Closed

Public key export doesn't work #12

hvge opened this issue Sep 11, 2018 · 0 comments
Labels
bug Something isn't working

Comments

@hvge
Copy link
Member

hvge commented Sep 11, 2018

I was following our installation & usage steps from the tool's documentation and it looks like that the export function doesn't work on my mac. The exporting function crashes at:

hvge@trogdor:bin-tool$ java -jar ssl-pinning-tool.jar export -k keypair.pem
2018-09-11 21:30:35 - SEVERE Failed to convert private key, error: sun.security.ec.ECPrivateKeyImpl cannot be cast to org.bouncycastle.jce.interfaces.ECPrivateKey
com.wultra.security.ssl.pinning.errorhandling.SSLPinningException: Failed to convert private key, error: sun.security.ec.ECPrivateKeyImpl cannot be cast to org.bouncycastle.jce.interfaces.ECPrivateKey
	at com.wultra.security.ssl.pinning.Application.exportPublicKey(Application.java:451)
	at com.wultra.security.ssl.pinning.Application.executeCommand(Application.java:189)
	at com.wultra.security.ssl.pinning.Application.main(Application.java:97)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:87)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:50)
	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)
Caused by: java.lang.ClassCastException: sun.security.ec.ECPrivateKeyImpl cannot be cast to org.bouncycastle.jce.interfaces.ECPrivateKey
	at com.wultra.security.ssl.pinning.Application.exportPublicKey(Application.java:447)
	... 10 more

I was following our own BC installation steps and BouncyCastle is the last provider in the java.security file.

Other variables:

  • I just downloaded tool from official releases
  • Java version
    hvge@trogdor:bin-tool$ java -version
    java version "1.8.0_121"
    Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
    Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
    
  • BC version: bcprov-jdk15on-1.60.jar
@hvge hvge added the bug Something isn't working label Sep 11, 2018
romanstrobl added a commit that referenced this issue Sep 11, 2018
Fix #12: Public key export doesn't work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant