Skip to content

Commit 4148ad5

Browse files
committed
fixup! feat(binding-coap): add support for client certificates
1 parent 10f3398 commit 4148ad5

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

lib/src/binding_coap/coap_client.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ class _InternalCoapConfig extends CoapConfigDefault {
2727
dtlsVerify = coapConfig.dtlsVerify,
2828
dtlsWithTrustedRoots = coapConfig.dtlsWithTrustedRoots,
2929
rootCertificates = coapConfig.rootCertificates,
30-
clientCertificateFileName = coapConfig.clientCertificateFileName,
31-
clientKeyFileName = coapConfig.clientKeyFileName,
30+
clientCertificate = coapConfig.clientCertificate,
31+
clientPrivateKey = coapConfig.clientPrivateKey,
3232
_verifyPrivateKey = coapConfig.verifyPrivateKey;
3333

3434
@override
@@ -47,10 +47,10 @@ class _InternalCoapConfig extends CoapConfigDefault {
4747
final List<Uint8List> rootCertificates;
4848

4949
@override
50-
final String? clientCertificateFileName;
50+
final coap.ClientCertificate? clientCertificate;
5151

5252
@override
53-
final String? clientKeyFileName;
53+
final coap.ClientPrivateKey? clientPrivateKey;
5454

5555
final bool _verifyPrivateKey;
5656

lib/src/binding_coap/coap_config.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import "dart:typed_data";
88

9+
import "package:coap/coap.dart";
910
import "package:meta/meta.dart";
1011

1112
/// Allows for configuring the behavior of CoAP clients and servers.
@@ -22,8 +23,8 @@ class CoapConfig {
2223
this.rootCertificates = const [],
2324
this.dtlsWithTrustedRoots = true,
2425
this.dtlsVerify = true,
25-
this.clientKeyFileName,
26-
this.clientCertificateFileName,
26+
this.clientCertificate,
27+
this.clientPrivateKey,
2728
this.verifyPrivateKey = false,
2829
});
2930

@@ -62,10 +63,10 @@ class CoapConfig {
6263
final Duration multicastDiscoveryTimeout;
6364

6465
/// Name of a file referring to a client certificate used with DTLS PKI mode.
65-
final String? clientCertificateFileName;
66+
final ClientCertificate? clientCertificate;
6667

6768
/// Name of a file referring to a private client key used with DTLS PKI mode.
68-
final String? clientKeyFileName;
69+
final ClientPrivateKey? clientPrivateKey;
6970

7071
/// Whether the private key of the client certificate should be verified when
7172
/// creating the DTLS context.

0 commit comments

Comments
 (0)