TrustPinConfiguration class

Configuration for the TrustPin SDK.

Contains all credentials and settings needed to initialize TrustPin. Create an instance and pass it to TrustPin.setup to configure the SDK.

Example

const config = TrustPinConfiguration(
  organizationId: 'your-org-id',
  projectId: 'your-project-id',
  publicKey: 'LS0tLS1CRUdJTi...',
);

await TrustPin.shared.setup(config);

You can also load the configuration from a JSON asset bundled with your app using TrustPinConfiguration.fromAssets.

Constructors

TrustPinConfiguration({required String organizationId, required String projectId, required String publicKey, Uri? configurationURL, TrustPinMode mode = TrustPinMode.strict})
Creates a TrustPin configuration.
const

Properties

configurationURL Uri?
Optional override for the configuration source.
final
hashCode int
The hash code for this object.
no setterinherited
mode TrustPinMode
The pinning mode controlling behavior for unregistered domains.
final
organizationId String
Your organization identifier from the TrustPin dashboard.
final
projectId String
Your project identifier from the TrustPin dashboard.
final
publicKey String
Base64-encoded public key issued by the TrustPin dashboard.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

fromAssets({String assetPath = 'trustpin.json', AssetBundle? bundle}) Future<TrustPinConfiguration>
Loads a configuration from a JSON asset bundled with the Flutter app.