DtlsClient class
Client for connecting to DTLS Servers and sending UDP packets with encrpyted payloads afterwards.
Uses a RawDatagramSocket for connection establishment and sending. This socket can either be created by the DtlsClient itself, using the bind method, or provided by the user with the regular constructor.
Connections to a peer are established using the connect method. Here, you can either provide PskCredentials or EcdsaKeys for using Elliptic Curve Cryptography (ECC). If the connection is successful, a DtlsConnection is returned that can be used for sending the actual application data.
Closing the DtlsClient with the close method also closes all existing DtlsConnections.
Constructors
- DtlsClient(RawDatagramSocket _socket, {int maxTimeoutSeconds = 60, TinyDTLS? tinyDTLS})
- Creates a new DtlsClient that uses a pre-existing RawDatagramSocket.
Properties
Methods
-
close(
{bool closeExternalSocket = false}) → void - Closes this DtlsClient.
-
connect(
InternetAddress address, int port, {PskCallback? pskCallback, EcdsaKeys? ecdsaKeys, void eventListener(DtlsEvent event)?}) → Future< DtlsConnection> -
Establishes a
DtlsClientConnection
with a peer using the givenaddress
andport
. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited