java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: invalid key format


Solutions on the web

Solution icon of stackoverflow
java.security.InvalidKeyException: invalid key format

Solution icon of oraclecommunity
via Oracle Community by 843811, 1 year ago
java.security.InvalidKeyException: invalid key format

Solution icon of stackoverflow
java.security.InvalidKeyException: invalid key format

Solution icon of stackoverflow
java.security.InvalidKeyException: invalid key format

Solution icon of stackoverflow
java.security.InvalidKeyException: invalid key format

Solution icon of stackoverflow
java.security.InvalidKeyException: invalid key format

Solution icon of stackoverflow
via Stack Overflow by Ganesh Satpute
, 1 year ago
java.security.InvalidKeyException: invalid key format

Solution icon of stackoverflow
java.security.InvalidKeyException: invalid key format

Solution icon of oraclecommunity
via Oracle Community by 843811, 1 year ago
java.security.InvalidKeyException: IOException: null

Solution icon of coderanch
via Coderanch by Alex Fox, 10 months ago
java.security.InvalidKeyException: IOException: null

Stack trace

java.security.spec.InvalidKeySpecException: java.security.InvalidKeyException: invalid key format
	at sun.security.rsa.RSAKeyFactory.engineGeneratePublic(RSAKeyFactory.java:205)
	at java.security.KeyFactory.generatePublic(KeyFactory.java:334)
	at j.MyClass.parsePublicKey(MyClass.java:136)
	at j.MyClass.main(MyClass.java:223)
Caused by: java.security.InvalidKeyException: invalid key format
	at sun.security.x509.X509Key.decode(X509Key.java:387)
	at sun.security.x509.X509Key.decode(X509Key.java:403)
	at sun.security.rsa.RSAPublicKeyImpl.<init>(RSAPublicKeyImpl.java:84)
	at sun.security.rsa.RSAKeyFactory.generatePublic(RSAKeyFactory.java:298)
	at sun.security.rsa.RSAKeyFactory.engineGeneratePublic(RSAKeyFactory.java:201)
	... 3 more

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

Once, 8 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
2 times, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
3 more bugmates