Companion

object Companion

Properties

Link copied to clipboard

The default (singleton) TrustPin instance.

Link copied to clipboard

true when the default instance has a validated pinning payload cached.

Functions

Link copied to clipboard
suspend fun awaitConfiguration(timeout: Long = TrustPinConstants.DEFAULT_OPERATION_TIMEOUT_MS)

Waits for the default instance's configuration to be fetched and validated — the explicit fail-closed gate.

Link copied to clipboard
fun awaitConfigurationBlocking(timeout: Long = TrustPinConstants.DEFAULT_OPERATION_TIMEOUT_MS)

Blocking version of awaitConfiguration on the default instance.

Link copied to clipboard
suspend fun fetchCertificate(host: String, port: Int = 443, timeout: Long = TrustPinConstants.DEFAULT_OPERATION_TIMEOUT_MS): String

Fetches a leaf certificate from the default TrustPin instance.

Link copied to clipboard
fun fetchCertificateBlocking(host: String, port: Int = 443, timeout: Long = TrustPinConstants.DEFAULT_OPERATION_TIMEOUT_MS): String

Blocking version of fetchCertificate on the default instance.

Link copied to clipboard

Returns a named TrustPin instance, creating it on first access.

Link copied to clipboard

Creates an SSLSocketFactory bound to the default TrustPin instance.

Link copied to clipboard

Creates a literally matched TLS pair bound to the default TrustPin instance.

Link copied to clipboard

Creates an X509TrustManager bound to the default TrustPin instance.

Link copied to clipboard

Sets the log level on the default TrustPin instance.

Link copied to clipboard

Routes SDK log output to sink instead of the built-in default (Android logcat on Android, standard output on the JVM).

Link copied to clipboard
suspend fun setup(configuration: TrustPinConfiguration)

Initializes the default TrustPin instance from a TrustPinConfiguration.

Link copied to clipboard

Blocking version of setup on the default instance.

Link copied to clipboard

Observes pin-validation outcomes across all TrustPin instances — the hook for field telemetry (recording suspected machine-in-the-middle events) and rollout monitoring.

Link copied to clipboard
suspend fun verify(domain: String, certificate: X509Certificate, timeout: Long = TrustPinConstants.DEFAULT_OPERATION_TIMEOUT_MS)

Verifies a certificate against the default TrustPin instance.

suspend fun verify(domain: String, certificate: String, timeout: Long = TrustPinConstants.DEFAULT_OPERATION_TIMEOUT_MS)

Verifies a PEM-encoded certificate against the default TrustPin instance.

suspend fun verify(domain: String, chain: List<X509Certificate>, timeout: Long = TrustPinConstants.DEFAULT_OPERATION_TIMEOUT_MS)

Verifies a certificate chain against the default TrustPin instance.

Link copied to clipboard
fun verifyBlocking(domain: String, certificate: X509Certificate, timeout: Long = TrustPinConstants.DEFAULT_OPERATION_TIMEOUT_MS)

Blocking version of verify on the default instance.

fun verifyBlocking(domain: String, certificate: String, timeout: Long = TrustPinConstants.DEFAULT_OPERATION_TIMEOUT_MS)

Blocking version of verify with PEM on the default instance.

fun verifyBlocking(domain: String, chain: List<X509Certificate>, timeout: Long = TrustPinConstants.DEFAULT_OPERATION_TIMEOUT_MS)

Blocking version of verify with a certificate chain on the default instance.