verify

suspend fun verify(domain: String, certificate: X509Certificate)(source)

Verifies an X.509 certificate against the configured pins for domain.

Parameters

domain

The domain name to validate (e.g., "api.example.com")

certificate

X.509 certificate object to verify

Throws

if certificate doesn't match any configured pins

if all configured pins have expired

if domain is not configured (strict mode only)


suspend fun verify(domain: String, certificate: String)(source)

Verifies a PEM-encoded certificate against the configured pins for domain.

Parameters

domain

The domain name to validate (e.g., "api.example.com")

certificate

PEM-encoded certificate string

Throws

if the PEM string cannot be parsed

if certificate doesn't match any configured pins