TrustPinError

sealed class TrustPinError : Exception

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

Link copied to clipboard

All pins configured for the domain have expired.

Link copied to clipboard

TrustPin.setup was called on an instance that has already completed setup successfully.

Link copied to clipboard

The downloaded configuration failed an integrity check.

Link copied to clipboard

The downloaded configuration failed validation.

Link copied to clipboard

The domain is not registered for pinning.

Link copied to clipboard

The pinning configuration could not be retrieved.

Link copied to clipboard

The setup parameters are invalid (missing, malformed, or rejected during validation).

Link copied to clipboard

The server certificate is missing, malformed, or could not be parsed as X.509.

Link copied to clipboard

An internal lock could not be acquired within the configured timeout.

Link copied to clipboard

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.

Link copied to clipboard

The presented certificate does not match any configured pin for the domain.

Link copied to clipboard

Another TrustPin.setup call is already in flight on this instance.

Link copied to clipboard

The platform's TLS stack could not be configured for pinning.

Link copied to clipboard

The operation did not complete within the supplied timeout.

Link copied to clipboard

The SDK is refusing to operate because the runtime environment is not a supported production Android device.

Properties

Link copied to clipboard
open val cause: Throwable?
Link copied to clipboard
Link copied to clipboard
open val message: String?
Link copied to clipboard
Link copied to clipboard