CertificatePinningDatasource class

Pure-Dart datasource for TLS certificate pinning validation.

Connects to host:443, retrieves the server certificate, and compares the SHA-256 fingerprint of its Subject Public Key Info (SPKI) against the provided pins. Pinning the SPKI instead of the full certificate means that certificate renewals (which keep the same key pair) do not break pinning.

Pin format: sha256/<base64-encoded-sha256-of-spki> (HPKP format).

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validateCertificate({required String host, required List<String> pins, Duration timeout = const Duration(seconds: 10)}) Future<bool>

Operators

operator ==(Object other) bool
The equality operator.
inherited