21:50, EET
February 6, 2014
I’m using for a school project the OPC UA Java SDK SampleConsoleClient and -Server. Everything worked well until some days ago, when I had to reinstall Eclipse.
Since then I cannot run the code which was running before.
When I start the code the first time, the Certificate should be created in the PKI/CA/private folder. Well the .der and as well the .pem files are being created, but the .pem file is empty and the following exception appears:
Exception in thread “main” org.bouncycastle.util.io.pem.PemGenerationException: encoding exception: exception using cipher – please check password and data.
at org.bouncycastle.openssl.MiscPEMGenerator.generate(Unknown Source)
at org.bouncycastle.util.io.pem.PemWriter.writeObject(Unknown Source)
at org.bouncycastle.openssl.PEMWriter.writeObject(Unknown Source)
at org.opcfoundation.ua.transport.security.PrivKey.save(Unknown Source)
at com.prosysopc.ua.ApplicationIdentity.loadOrCreateCertificate(Unknown Source)
at com.prosysopc.ua.ApplicationIdentity.loadOrCreateCertificate(Unknown Source)
at com.prosysopc.ua.ApplicationIdentity.loadOrCreateCertificate(Unknown Source)
at com.prosysopc.ua.samples.SampleConsoleServer.initialize(SampleConsoleServer.java:1172)
at com.prosysopc.ua.samples.SampleConsoleServer.main(SampleConsoleServer.java:173)
Caused by: org.bouncycastle.openssl.EncryptionException: exception using cipher – please check password and data.
at org.bouncycastle.openssl.PEMUtilities.crypt(Unknown Source)
at org.bouncycastle.openssl.MiscPEMGenerator.createPemObject(Unknown Source)
… 9 more
Caused by: java.lang.SecurityException: JCE cannot authenticate the provider BC
at javax.crypto.Cipher.getInstance(Cipher.java:642)
… 11 more
Caused by: java.util.jar.JarException: Class is on the bootclasspath
at javax.crypto.JarVerifier.verify(JarVerifier.java:247)
at javax.crypto.JceSecurity.verifyProviderJar(JceSecurity.java:161)
at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:187)
at javax.crypto.Cipher.getInstance(Cipher.java:638)
… 11 more
9:33, EET
December 21, 2011
I am not sure how this is related to the Eclipse reinstall. It sounds more like you would have repackaged the Bouncy Castle.
Check this, for example for more about that.
20:06, EET
February 6, 2014
Thanks for your Feedback.
You’re right, its the Bouncy Castle which could not be found anymore. Instead of linkin the jar files to the library and add to the Build Path I just put the jar files now right into the Workspace/Project and then added them to the Build Path.
Sorry for my late answer and thanks again.
Most Users Ever Online: 1919
Currently Online:
43 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Heikki Tahvanainen: 402
hbrackel: 144
rocket science: 88
pramanj: 86
Francesco Zambon: 83
Ibrahim: 78
Sabari: 62
kapsl: 57
gjevremovic: 49
Xavier: 43
Member Stats:
Guest Posters: 0
Members: 726
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1525
Posts: 6456
Newest Members:
forrestdilke5, ernestoportus31, martin123, rickie5305, shaylamaggard4, rickyjuarez140, jonathonmcintyre, fannielima, kristiewinkle8, rustModerators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1028, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0
Administrators: admin: 1