diff --git a/lib/src/binding_coap/coap_client.dart b/lib/src/binding_coap/coap_client.dart index 89ef2916..39d47cf5 100644 --- a/lib/src/binding_coap/coap_client.dart +++ b/lib/src/binding_coap/coap_client.dart @@ -27,8 +27,8 @@ class _InternalCoapConfig extends CoapConfigDefault { dtlsVerify = coapConfig.dtlsVerify, dtlsWithTrustedRoots = coapConfig.dtlsWithTrustedRoots, rootCertificates = coapConfig.rootCertificates, - clientCertificateFileName = coapConfig.clientCertificateFileName, - clientKeyFileName = coapConfig.clientKeyFileName, + clientCertificate = coapConfig.clientCertificate, + clientPrivateKey = coapConfig.clientPrivateKey, _verifyPrivateKey = coapConfig.verifyPrivateKey; @override @@ -47,10 +47,10 @@ class _InternalCoapConfig extends CoapConfigDefault { final List rootCertificates; @override - final String? clientCertificateFileName; + final coap.ClientCertificate? clientCertificate; @override - final String? clientKeyFileName; + final coap.ClientPrivateKey? clientPrivateKey; final bool _verifyPrivateKey; diff --git a/lib/src/binding_coap/coap_config.dart b/lib/src/binding_coap/coap_config.dart index f98c5583..a1cad6ef 100644 --- a/lib/src/binding_coap/coap_config.dart +++ b/lib/src/binding_coap/coap_config.dart @@ -6,6 +6,7 @@ import "dart:typed_data"; +import "package:coap/coap.dart"; import "package:meta/meta.dart"; /// Allows for configuring the behavior of CoAP clients and servers. @@ -22,8 +23,8 @@ class CoapConfig { this.rootCertificates = const [], this.dtlsWithTrustedRoots = true, this.dtlsVerify = true, - this.clientKeyFileName, - this.clientCertificateFileName, + this.clientCertificate, + this.clientPrivateKey, this.verifyPrivateKey = false, }); @@ -62,10 +63,10 @@ class CoapConfig { final Duration multicastDiscoveryTimeout; /// Name of a file referring to a client certificate used with DTLS PKI mode. - final String? clientCertificateFileName; + final ClientCertificate? clientCertificate; /// Name of a file referring to a private client key used with DTLS PKI mode. - final String? clientKeyFileName; + final ClientPrivateKey? clientPrivateKey; /// Whether the private key of the client certificate should be verified when /// creating the DTLS context.