ValidationEvent

sealed class ValidationEvent : Event

Represents a validation event within the ShieldCert SDK. This sealed class has specific validation event types as subclasses.

internal fun validationEventHandlingExample() {
val validationEvent: ValidationEvent = ValidationEvent.Trusted("fingerprint123", "example.com")

when (validationEvent) {
ValidationEvent.Empty -> println("No validation has occurred yet.")
is ValidationEvent.Trusted -> println("Certificate for ${validationEvent.host} is trusted. Fingerprint: ${validationEvent.fingerprint}")
ValidationEvent.Untrusted -> println("Certificate is untrusted.")
is ValidationEvent.NotFound -> println("Certificate for ${validationEvent.host} not found in pinning configuration.")
}
}

Inheritors

Constructors

Link copied to clipboard
protected constructor()

Types

Link copied to clipboard
data object Empty : ValidationEvent

Represents an empty validation event, typically when no validation has occurred.

Link copied to clipboard
data class NotFound(val host: String) : ValidationEvent

The certificate not found in sslpinning.

Link copied to clipboard
data class Trusted(val fingerprint: String, val host: String) : ValidationEvent

The certificate is trusted.

Link copied to clipboard

The certificate is not trusted.