Hello,
I am implementing a bundle to do some AES Encryption
I added the third lib jar: javax.crypto directly in my bundle, in the manifest I have
Bundle-ClassPath: .,
lib/javax-crypto.jar
the problem is that I am getting this exception:
java.lang.ClassCastException: com.sun.crypto.provider.AESCipher$General cannot be cast to javax.crypto.CipherSpi
at javax.crypto.Cipher.getInstance(Cipher.java:166)
at org.eclipse.kura.AES.services.AesServices.decrypt(AesServices.java:33)
at org.eclipse.kura.loRaService.LoRaMessage.addReceivedInfoToLoRaMsg(LoRaMessage.java:85)
at org.eclipse.kura.loRaService.LoRaCommunicatorThread.run(LoRaCommunicatorThread.java:49)
at java.lang.Thread.run(Thread.java:745)
I dont know why my bundle is trying to do the above cast. I dont know from where he is getting the class: com.sun.crypto.provider.AESCipher$General
Here is my manifest:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: AES
Bundle-SymbolicName: org.eclipse.kura.AES
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Import-Package: org.osgi.service.component;version="1.2.0",
org.slf4j;version="1.7.21"
Service-Component: component.xml
Export-Package: org.eclipse.kura.AES.services
Bundle-ClassPath: .,
lib/javax-crypto.jar
Thanks !
[Updated on: Tue, 18 April 2017 16:11]
Report message to a moderator