As your final data in the TRAP v2 message will be of OctetString type, you should do the following,
- Construct the
Sequenceobject as above. -
Construct an
OctetStringobject to embed theSequenceobject, such asvar stringData = new OctetString(seq.ToBytes());.
OctetString object can be sent on the wire. The receiver just needs to decode it correctly so as to get the Sequence inside, such as var seq = (Sequence)DataFactory.CreateSnmpData(stringData.GetRaw());