java.security.InvalidKeyException: Not an EC key: ECDH

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via GitHub by nikhil32
, 6 months ago
Not an EC key: ECDH
via GitHub by nikhil32
, 1 year ago
Not an EC key: ECDH
via GitHub by Pratappatil1992
, 1 year ago
java.security.InvalidKeyException: Not an EC key: ECDH
at sun.security.ec.ECKeyFactory.checkKey(ECKeyFactory.java:121)
at sun.security.ec.ECKeyFactory.toECKey(ECKeyFactory.java:90)
at sun.security.ec.ECDHKeyAgreement.engineInit(ECDHKeyAgreement.java:67)
at javax.crypto.KeyAgreement.implInit(KeyAgreement.java:341)
at javax.crypto.KeyAgreement.chooseProvider(KeyAgreement.java:373)
at javax.crypto.KeyAgreement.init(KeyAgreement.java:465)
at javax.crypto.KeyAgreement.init(KeyAgreement.java:436)
at nl.martijndwars.webpush.HttpEce.deriveDH(HttpEce.java:117)
at nl.martijndwars.webpush.HttpEce.deriveKey(HttpEce.java:54)
at nl.martijndwars.webpush.HttpEce.encrypt(HttpEce.java:166)
at nl.martijndwars.webpush.PushService.encrypt(PushService.java:62)

Users with the same issue

You are the first who have seen this exception.

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.