Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Creating a new Certificate when running the OPC UA Java SDK SampleConsoleClient the first time
February 6, 2014
21:50, EET
Avatar
Mike
New Member
Members
Forum Posts: 2
Member Since:
February 7, 2014
sp_UserOfflineSmall Offline

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

February 7, 2014
9:33, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1009
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

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.

February 19, 2014
20:06, EET
Avatar
Mike
New Member
Members
Forum Posts: 2
Member Since:
February 7, 2014
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
17 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

ibrahim: 75

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

fred: 41

Member Stats:

Guest Posters: 0

Members: 685

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6259

Newest Members:

fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule, rashadbrownrigg, christi10l, ahamad1, Flores Frederick, ellenmoss

Moderators: Jouni Aro: 1009, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1