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)
Jump to navigation Jump to search

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