How to publish or subscribe to secure OPC UA PubSub messages

From OPC Labs Knowledge Base
Revision as of 07:26, 20 March 2021 by User (talk | contribs)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Publish secure messages in UADemoPublisher

publish --EnabledConnection DynamicLayoutConnection --EnabledDataSetWriter SimpleWriter --SecurityMode SignAndEncrypt --SecurityKeyServiceUri opc.tcp://localhost:48010 --SecurityKeyServiceMessageSecurity SignAndEncrypt --SecurityKeyServiceUserInfo root:secret --SecurityGroupId TestGroup

Subscribe to secure messages in OpcCmd utility

uaSubscriber subscribeDataSet opc.udp://239.0.0.1:4840 --SecurityMode SecuritySignAndEncrypt --SecurityKeyServiceUri opc.tcp://localhost:48010 --SksTemplateMessageSecurity SecuritySignAndEncrypt --SksTemplateUser root:secret --SecurityGroupId TestGroup

Enable security event tracing in command-line tools

Use the following command in the OpcCmd utility or in UADemoPublisher (at the beginning of the program session) to enable tracing of security-related events:

!diagnostics switches setValue 1 --multiple --contains Security --typeName BooleanSwitch

Related reading