Package-level declarations

The public API: com.alirezaiyan.passki.Passkeys, results and errors, capabilities, signals and the setup doctor.

The public API: com.alirezaiyan.passki.Passkeys, results and errors, capabilities, signals and the setup doctor.

The public API: com.alirezaiyan.passki.Passkeys, results and errors, capabilities, signals and the setup doctor.

The public API: com.alirezaiyan.passki.Passkeys, results and errors, capabilities, signals and the setup doctor.

The public API: com.alirezaiyan.passki.Passkeys, results and errors, capabilities, signals and the setup doctor.

Types

Link copied to clipboard
class DoctorCheck(val name: String, val status: DoctorStatus, val message: String, val fixHint: String?, val id: String?)

One diagnosed item of a DoctorReport.

Link copied to clipboard
class DoctorReport(val rpId: String, val checks: List<DoctorCheck>)

Result of PasskeyDoctor.run: one DoctorCheck per diagnosed item, in the order they ran.

Link copied to clipboard
Link copied to clipboard

Marks declarations shared between PassKi modules. Not part of the stable API.

Link copied to clipboard

Whether a new passkey must have large-blob storage (PasskeyExtensions.withLargeBlob).

Link copied to clipboard
class PasskeyAssertion(val json: String, val credentialId: String, val userHandle: String?, val prf: PrfResults? = null, val largeBlob: ByteArray? = null, val largeBlobWritten: Boolean? = null, val rpId: String)

Result of Passkeys.signIn. Send json to the server. Instances are created by PassKi; the constructor is internal API so fields can be added without breaking binaries.

Link copied to clipboard
class PasskeyCapabilities(val isSupported: Boolean, val immediateSignIn: Boolean, val unifiedPasswordSignIn: Boolean, val conditionalCreate: Boolean, val signals: Boolean, val autofill: Boolean)

What this device/OS supports. Instances are created by PassKi; the constructor is internal API so fields can be added without breaking binaries.

Link copied to clipboard
actual object PasskeyDoctor

Diagnoses passkey setup for a relying party on this device: platform support, app configuration and the well-known association files (assetlinks.json on Android, apple-app-site-association on iOS).

expect object PasskeyDoctor

Diagnoses passkey setup for a relying party on this device: platform support, app configuration and the well-known association files (assetlinks.json on Android, apple-app-site-association on iOS).

actual object PasskeyDoctor

Diagnoses passkey setup for a relying party on this device: platform support, app configuration and the well-known association files (assetlinks.json on Android, apple-app-site-association on iOS).

actual object PasskeyDoctor

Diagnoses passkey setup for a relying party on this device: platform support, app configuration and the well-known association files (assetlinks.json on Android, apple-app-site-association on iOS).

actual object PasskeyDoctor

Diagnoses passkey setup for a relying party on this device: platform support, app configuration and the well-known association files (assetlinks.json on Android, apple-app-site-association on iOS).

Link copied to clipboard
sealed class PasskeyError

Every way a passkey operation can fail, across all platforms. fixHint is non-null when a developer can fix the cause (configuration, options). checkId names the setup check from the PassKi check catalog that covers the cause, the same ID PasskeyDoctor, ./gradlew passkiCheck and the web verifier report, and docsUrl links its docs page.

Link copied to clipboard

Thrown by getOrThrow. The message includes PasskeyError.fixHint and PasskeyError.docsUrl when there are ones.

Link copied to clipboard

Adds typed WebAuthn extensions to the options JSON your server produced, before you pass it to Passkeys.register or Passkeys.signIn. Read the outputs from PasskeyRegistration / PasskeyAssertion.

Link copied to clipboard
class PasskeyRegistration(val json: String, val credentialId: String, val transports: List<String>, val authenticatorAttachment: String?, val prfEnabled: Boolean? = null, val prf: PrfResults? = null, val largeBlobSupported: Boolean? = null, val rpId: String)

Result of Passkeys.register. Send json to the server. Instances are created by PassKi; the constructor is internal API so fields can be added without breaking binaries.

Link copied to clipboard
sealed interface PasskeyResult<out T>

Outcome of a passkey operation: either Success with a value or Failure with a typed PasskeyError.

Link copied to clipboard
interface Passkeys

Entry point. Obtain with Passkeys; no platform handles needed.

Link copied to clipboard
interface PasskeySignals

Tells credential providers about server-side changes (WebAuthn Signal API). Requires PasskeyCapabilities.signals.

Link copied to clipboard
object PassKi

Process-wide PassKi settings. Changes take effect for the next call, from any thread.

Link copied to clipboard

Manual initialisation for apps that disabled androidx.startup.

Link copied to clipboard
fun interface PasskiLogHandler

Receives PassKi's log entries. tag is always PassKi; message never contains challenges, user handles, options or response JSON, passwords, PRF outputs or large-blob data, and credential IDs are shortened. throwable is the platform error behind a PasskeyError.Unknown, if there is one.

Link copied to clipboard

How much PassKi logs; each level includes the ones above it.

Link copied to clipboard
class PrfResults(val first: ByteArray, val second: ByteArray?)

Outputs of the WebAuthn prf extension (PasskeyExtensions.withPrf): one 32-byte result per salt.

Link copied to clipboard
sealed interface SignalOutcome

What a PasskeySignals call did.

Link copied to clipboard
sealed interface SignInCredential

What the user picked in Passkeys.signInOrPassword.

Link copied to clipboard

How Passkeys.signIn presents itself.

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
suspend fun Passkeys.autofillSignIn(optionsJson: String, anchor: View): PasskeyResult<PasskeyAssertion>

signIn(optionsJson, SignInMode.Autofill) with the request attached to the focused view inside anchor (or anchor itself), instead of the focused view PassKi finds on its own.

Link copied to clipboard

Returns the error on failure, or null on success.

Link copied to clipboard
inline fun <T, R> PasskeyResult<T>.fold(onSuccess: (T) -> R, onFailure: (PasskeyError) -> R): R

Returns onSuccess of the value or onFailure of the error; exactly one of them runs. The usual way to turn a result into your own type:

Link copied to clipboard

Returns the value on success, or null on failure.

Link copied to clipboard

Returns the value on success, or throws a PasskeyException carrying the error.

Link copied to clipboard
inline fun <T, R> PasskeyResult<T>.map(transform: (T) -> R): PasskeyResult<R>

Transforms the value on success; failures pass through unchanged.

Link copied to clipboard

Transforms the error on failure, e.g. into another PasskeyError; successes pass through unchanged.

Link copied to clipboard
inline fun <T> PasskeyResult<T>.onFailure(action: (PasskeyError) -> Unit): PasskeyResult<T>

Runs action with the error if this is a PasskeyResult.Failure; returns this result unchanged.

Link copied to clipboard
inline fun <T> PasskeyResult<T>.onSuccess(action: (T) -> Unit): PasskeyResult<T>

Runs action with the value if this is a PasskeyResult.Success; returns this result unchanged.

Link copied to clipboard
actual fun Passkeys(): Passkeys

Creates the Passkeys implementation for the current platform.

expect fun Passkeys(): Passkeys

Creates the Passkeys implementation for the current platform.

actual fun Passkeys(): Passkeys

Creates the Passkeys implementation for the current platform.

actual fun Passkeys(): Passkeys

Creates the Passkeys implementation for the current platform.

actual fun Passkeys(): Passkeys

Creates the Passkeys implementation for the current platform.

Link copied to clipboard
inline fun <T> PasskeyResult<T>.recover(transform: (PasskeyError) -> T): PasskeyResult<T>

Turns any failure into a success with transform's value; successes pass through unchanged. It hides setup errors too, so log them in transform (or use fold when failures need their own handling):

Link copied to clipboard

The same outcome as a kotlin.Result; a failure holds a PasskeyException whose error is the original error. For code built around Result (e.g. runCatching chains).