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


Solutions on the web

Solution icon of github
via GitHub by nikhil32
, 11 months ago
Not an EC key: ECDH

Solution icon of github
via GitHub by nikhil32
, 4 months ago
Not an EC key: ECDH

Solution icon of github
Not an EC key: ECDH

Stack trace

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)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.