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
Android UA client development: "Cannot create certificate for application"... exception
January 19, 2015
16:44, EET
Avatar
h-mike
New Member
Members
Forum Posts: 2
Member Since:
January 19, 2015
sp_UserOfflineSmall Offline

(We made a simple java desktop client (opcBasic) with Prosys SDK. It worked fine on windows thanks..)

I tried to build the same applikation on android system. It doesn’t work correctly, it throws exception (SecureIdentityException e1- see source code below):
exception: “Cannot create certificate for application”
(try-catch bloks are required only on Android)

try {
identity = ApplicationIdentity.loadOrCreateCertificate(appDescription, “Sample Organisation”,
/*Private Key Password */”opcua”,
/* Key File Path */privatePath,
/* CA certificate & private key */issuerCertificate,
/* Key Sizes for instance certificates to create */keySizes,
/* Enable renewing the certificate */true);
} catch (SecureIdentityException e1) {
e1.printStackTrace();
} catch (IOException e1) {
e1.printStackTrace();
}

Parameter Values:
on Windows:
privatePath: PKI\CA\private
appDescription:ApplicationDescription: ApplicationDescription (id=2129670906)
DiscoveryUrls=null
DiscoveryProfileUri=null
GatewayServerUri=null
ProductUri=null
ApplicationUri=null
ApplicationType=null
ApplicationName={class org.opcfoundation.ua.builtintypes.LocalizedText}(en) opcBasic
issuerCertificate: null
keySizes: null
———————————————————————————————
on Android:
privatePath: PKI/CA/private
appDescription: ApplicationDescription: ApplicationDescription (id=1100650048)
DiscoveryUrls=null
DiscoveryProfileUri=null
GatewayServerUri=null
ProductUri=null
ApplicationUri=null
ApplicationType=null
ApplicationName={class org.opcfoundation.ua.builtintypes.LocalizedText}(en) opcBasic
issuerCertificate: null
keySizes: null

Thanks in advanced!
Have you ever come accross such a problem like this before?

January 20, 2015
8:44, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1009
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

There is a known issue that might affect this. The Private Key of the application can be stored in PEM format on the sdcard (ExternalStorage), but not in the internal storage. So, check that the Key File Path in the ApplicationIdentity.loadOrCreateCertificate() call points to the sdcard.

January 21, 2015
17:01, EET
Avatar
h-mike
New Member
Members
Forum Posts: 2
Member Since:
January 19, 2015
sp_UserOfflineSmall Offline

Is it really necessary to use certificates? If not, than how do you avoid in your OPC Android client app to use them?

January 22, 2015
11:52, EET
Avatar
Jouni Aro
Moderator
Moderators
Forum Posts: 1009
Member Since:
December 21, 2011
sp_UserOfflineSmall Offline

No it’s not. If you connect without security, the certificates are not used. You can initialise the ApplicationIdentity without the certificates simply as

identity = new ApplicationIdentity();
identity.setApplicationDescription(appDescription);
Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
29 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: 680

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6259

Newest Members:

sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc, fen.pang@woodside.com, aytule

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