I have a customer requirement to implement OPC UA authentication using certificates in my client code, but I have been unable to find a solution. I've searched extensively for an answer on how to accomplish this but have so far come up empty. All I've been able to find is a few tidbits of info and comments inside the library's code. The provided examples show how to encrypt the channel using certificates and also how to login using username/password, but not, unless I'm missing something, how to login using a certificate.
With UA Expert I'm able to use my certificate to successfully authenticate and can confirm that it's authenticating with an X509IdentityToken. However I can't seem to replicate that behavior in my client code. I've set securityMode, securityPolicyUri and applicationUri which does encrypt the channel, but doesn't authenticate as needed.
If I allow anonymous on the server side my client code authenticates with an AnonymousIdentityToken .
When I disable anonymous on the server I receive the error: ActivateSession failed with error code BadIdentityTokenInvalid.
When I attempt to use an UA_X509IdentityToken for the userIdentityToken (like I'm guessing that maybe I should from examining the library code) the error I receive is: ActivateSession failed with error code BadApplicationSignatureInvalid.
I've search the documentation, Issues, and this Google group, but none seem to fully answer this question. Others have ask this or similar questions but all w/o an adequate response. The closest I've seen is a response from Julius that mentions the need to do some manual setup but he doesn't go into detail.
Can someone please point me to a code snippet or some working code that demonstrates certificate authentication in a client? Thanks!