Call to activate session gives error when using X509IdentityToken|OPC UA Implementation: Stacks, Tools, and Samples|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
Call to activate session gives error when using X509IdentityToken
Avatar
Deepali Ahirrao
Member
Members
Forum Posts: 25
Member Since:
08/16/2019
sp_UserOfflineSmall Offline
1
02/09/2020 - 05:10
sp_Permalink sp_Print

We are using OPC java stack (opc-ua-stack-1.4.1.jar)  in our client.

We are trying to create UserIdentityToken for the UserTokenType Certificate. Below is the code snippet. 

SignatureData signatureData = new SignatureData();
X509IdentityToken x509IdentityToken = EndpointUtil.createX509IdentityToken(endpoint, session.getServerNonce(), session.getClientCertificate(), session.getClientPrivateKey().getPrivateKey(), signatureData);
sessionChannel.activate(x509IdentityToken, signatureData); 

The activate method returns an error 'The session id is not valid'. What is it that we are doing wrong? Just a note - the same client certificate is used to create SecureChannel and Session with MessageSecurityMode as SignAndEncrypt.

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 57
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1415
Posts: 4778