Trust Pin Error
Exception types raised by TrustPin.
Every failure from TrustPin.setup and TrustPin.verify is one of the objects below. Match on the concrete type to drive your response policy.
try {
trustPin.verify("api.example.com", certificate)
} catch (e: TrustPinError.PinsMismatch) {
// Treat as potential MITM — do not retry.
} catch (e: TrustPinError.DomainNotRegistered) {
// Strict mode only: domain is not in your pinning configuration.
} catch (e: TrustPinError.ErrorFetchingPinningInfo) {
// Transient network/configuration fetch problem.
}See also
Inheritors
Types
All pins configured for the domain have expired.
TrustPin.setup was called on an instance that has already completed setup successfully.
The downloaded configuration failed an integrity check.
The downloaded configuration failed validation.
The domain is not registered for pinning.
The pinning configuration could not be retrieved.
The setup parameters are invalid (missing, malformed, or rejected during validation).
The server certificate is missing, malformed, or could not be parsed as X.509.
An internal lock could not be acquired within the configured timeout.
A verification operation was attempted before TrustPin.setup completed successfully on this instance. The configuration was never validated; the caller must call TrustPin.setup (and await its completion) before invoking TrustPin.verify / TrustPin.fetchCertificate / etc.
The presented certificate does not match any configured pin for the domain.
Another TrustPin.setup call is already in flight on this instance.
The platform's TLS stack could not be configured for pinning.
The operation did not complete within the supplied timeout.
The SDK is refusing to operate because the runtime environment is not a supported production Android device.