set Validation Listener
Observes pin-validation outcomes across all TrustPin instances — the hook for field telemetry (recording suspected machine-in-the-middle events) and rollout monitoring.
The listener is strictly observational: it is invoked after the verdict is decided, cannot veto or approve a connection, and its exceptions are swallowed. See TrustPinValidationListener for the exact reporting contract (definitive verdicts only, no re-delivery for cached verdicts) and the threading requirements.
TrustPin.setValidationListener(object : TrustPinValidationListener {
override fun onValidationFailure(
instanceId: String,
domain: String,
error: TrustPinError,
presentedCertificate: X509Certificate,
) {
telemetry.enqueue(PinFailureEvent(domain, error::class.simpleName))
}
})Content copied to clipboard
Parameters
listener
The observer, or null to remove the current one.