Gurux.DLMS.Objects.GXDLMSSecuritySetup.keyAgreement C# (CSharp) Méthode

keyAgreement() public méthode

Agree on one or more symmetric keys using the key agreement algorithm.
public keyAgreement ( GXDLMSClient client, byte[]>.List list ) : byte[][]
client GXDLMSClient DLMS client that is used to generate action.
list byte[]>.List List of keys.
Résultat byte[][]
        public byte[][] keyAgreement(GXDLMSClient client, List<KeyValuePair<GlobalKeyType, byte[]>> list)
        {
            if (list == null || list.Count == 0)
            {
                throw new ArgumentException("Invalid list. It is empty.");
            }
            GXByteBuffer bb = new GXByteBuffer();
            bb.SetUInt8(DataType.Array);
            bb.SetUInt8((byte)list.Count);
            foreach (KeyValuePair<GlobalKeyType, byte[]> it in list)
            {
                bb.SetUInt8(DataType.Structure);
                bb.SetUInt8(2);
                GXCommon.SetData(client.Settings, bb, DataType.Enum, it.Key);
                GXCommon.SetData(client.Settings, bb, DataType.OctetString, it.Value);
            }
            return client.Method(this, 3, bb.Array(), DataType.Array);
        }