Trust Pin Configuration
Configuration values for a TrustPin instance.
On Android — use one of the two Context-aware entry points
On Android the recommended setup paths are both Context-aware:
Bundled config: load the configuration from a
trustpin.jsoninassets/viaTrustPinConfiguration.fromAssets(context).
TrustPin.setup(TrustPinConfiguration.fromAssets(context))Programmatic config: build the configuration directly, then chain
.withAndroidStorage(context):
val config = TrustPinConfiguration(orgId, projId, publicKey)
.withAndroidStorage(context)
TrustPin.setup(config)Constructing a TrustPinConfiguration on Android without going through one of those paths is not recommended. The SDK still works, but the security profile of the instance is degraded. A one-shot info log is emitted in that case so the regression is operator-visible.
Single-use contract on Android
A configuration produced by withAndroidStorage(context) (or by fromAssets(context), which calls it internally) MUST be passed to exactly one TrustPin.setup call. Reusing the same decorated configuration for a second setup silently downgrades that subsequent instance. Build a fresh decorated configuration for each TrustPin instance you set up. See withAndroidStorage for a worked example.
On JVM
JVM consumers (server, desktop, embedded) construct the configuration directly and call TrustPin.setup. The Context-aware factories are unavailable and not needed on JVM.
TrustPin.setup(
TrustPinConfiguration(
organizationId = "my-org",
projectId = "my-project",
publicKey = "MFkwEwYH...",
mode = TrustPinMode.STRICT,
)
)Constructors
Properties
Optional override for the configuration source. Leave null for the default hosted configuration.
Behaviour for unregistered domains. See TrustPinMode.
Organization identifier from the TrustPin dashboard.
Functions
Programmatic Android setup — wires this configuration to the Android Context and returns the same instance.