A Script code can allow clearing Security Keys and also to add or remove a Security Key prior to processing a message (this is a Script of 'PreDoScript' type).
public keys(GraphBuilder builder) : base(builder) // don't remove this line
{
// Initialize your Script variables here.
// e.g. define chart types and open communication ports.
Plugins<Protocol>.Plugin.GetKeysManager().UpdateNetworkKeys
(new List<NetworkKey>()); // Clear all keys
}
// This method called BEFORE input message is processed,
// giving the chance to modify how this message will be
// processed. For example modifying the decryption keys
public override void PreDoScript(InputMessage inputMessage)
{
Plugins<Protocol>.Plugin.GetKeysManager().AddNetworkSecurityInfo
(new NetworkKey(-1, new byte[]{0xED,
0x94, 0x96, 0xE7, 0x97,
0xA6,
0x4A, 0x4B, 0x1A, 0x00, 0xC4, 0x32,
0xCA,
0x3B, 0x37, 0x06},-1, -1, null, null, 5), false);
}