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: 1026
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: 1026
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: 1919

Currently Online:
26 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: 1529

Posts: 6471

Newest Members:

gabriellabachus, Deakin, KTP25Zof, Wojciech Kubala, efrennowell431, wilfredostuart, caitlynfajardo, jeromechubb7, franciscagrimwad, adult_gallery

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0

Administrators: admin: 1