key spec not recognized
See original GitHub issueHello.
I am trying to use webpush-java with a web page and I created a Java test application (Jar file) to try it. But I have a problem:
When I run the test in the Windows prompt I get success and a push notification in my workstation, but when I run the test in the CMS (Opencms - Tomcat) I get the error:
09 ago 2018 11:44:17,794 ERROR [s.scheduler.CmsScheduleManager: 576] Error executing scheduled job "teste para notificacao".
**java.security.spec.InvalidKeySpecException: key spec not recognized**
at org.bouncycastle.jcajce.provider.asymmetric.util.BaseKeyFactorySpi.engineGeneratePublic(Unknown Source)
at org.bouncycastle.jcajce.provider.asymmetric.ec.KeyFactorySpi.engineGeneratePublic(Unknown Source)
at java.security.KeyFactory.generatePublic(Unknown Source)
at nl.martijndwars.webpush.Utils.loadPublicKey(Utils.java:70)
at nl.martijndwars.webpush.Notification.<init>(Notification.java:51)
at PushServiceTest.testPushChromeVapid(PushServiceTest.java:69)
at disparaTeste.launch(disparaTeste.java:22)
at org.opencms.scheduler.CmsScheduleManager.executeJob(CmsScheduleManager.java:568)
at org.opencms.scheduler.CmsScheduleManager$1.run(CmsScheduleManager.java:170)
I think the problem is in the command:
pushService.setPublicKey(Utils.loadPublicKey("BOH8nTQA5iZhl23+NCzGG9prvOZ5BE0MJXBW+GUkQIvRVTVB32JxmX0V1j6z0r7rnT7+bgi6f2g5fMPpAh5brqM="));
Have you some suggestion to solve the problem?
Thanks a lot.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
InvalidKeyException: Key Spec Not Recognised - java
The weird thing is that my encryptFile method works perfectly, but decryptFile is throwing the error. I'm not entirely sure why.
Read more >java.security.spec.InvalidKeySpecException: key spec not ...
RE: java.security.spec.InvalidKeySpecException: key spec not recognized ... I found the solution this error comes because of the bouncycastle jar. I have used web ......
Read more >java.security.spec.InvalidKeySpecException: key spec not ...
I'm asking, because DSA keys have been disabled for some time now on most Linux distributions for security reasons. Apparently, those have now...
Read more >InvalidKeySpecException during client authentication with ...
PemException: java.security.spec.InvalidKeySpecException: encoded key spec not recognized: algorithm identifier 1.2.840.10045.2.1 in key not recognised.
Read more >JGit exception java.security.spec.InvalidKeySpecException ...
EdDSAPublicKeySpec: java.security.spec.InvalidKeySpecException: key spec not recognised: class net.i2p.crypto.eddsa.spec.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You were correct. The problem was solved. Thanks a lot.
No, I am not passing null
below is the sample of input and output what i am getting.
Input BN7JDTjiYI5Gcmi9OuNNggbRZG5ltDQfW0XiAUgHKaOiDnrrYC5nr6MgzsApJPf-C_SrIRQfTKWtFHzPIqbvYsI=
Output
Uint8Array(65) [4, 222, 201, 13, 56, 226, 96, 142, 70, 114, 104, 189, 58, 227, 77, 130, 6, 209, 100, 110, 101, 180, 52, 31, 91, 69, 226, 1, 72, 7, 41, 163, 162, 14, 122, 235, 96, 46, 103, 175, 163, 32, 206, 192, 41, 36, 247, 254, 11, 244, 171, 33, 20, 31, 76, 165, 173, 20, 124, 207, 34, 166, 239, 98, 194]