CalljmpDevice class abstract
Abstract platform interface for device attestation and integrity verification.
This class defines the contract that platform-specific implementations must follow to provide device attestation capabilities. It supports both iOS App Attestation and Android Play Integrity verification.
Platform Interface Pattern
This follows Flutter's platform interface pattern where:
- Abstract interface defines the contract
- Platform-specific implementations provide actual functionality
- Default implementation uses method channels for native communication
Supported Operations
- iOS App Attestation: Generate keys and create attestations using Secure Enclave
- Android Play Integrity: Request integrity tokens for app verification
Example Usage
// Use the default instance
final device = CalljmpDevice.instance;
// iOS: Generate attestation key
final keyId = await device.appleGenerateAttestationKey();
// iOS: Create attestation
final attestation = await device.appleAttestKey(keyId, challengeData);
// Android: Request integrity token
final integrity = await device.androidRequestIntegrityToken(
projectNumber,
challengeData,
);
Custom Implementation
To provide a custom implementation:
class CustomCalljmpDevice extends CalljmpDevice {
@override
Future<String> appleGenerateAttestationKey() async {
// Custom implementation
}
// ... implement other methods
}
// Register the custom implementation
CalljmpDevice.instance = CustomCalljmpDevice();
- Inheritance
-
- Object
- PlatformInterface
- CalljmpDevice
- Implementers
Constructors
- CalljmpDevice()
- Constructs a CalljmpDevice instance.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
androidRequestIntegrityToken(
int? cloudProjectNumber, String data) → Future< AndroidIntegrityResult> - Requests an Android Play Integrity API token for app verification.
-
appleAttestKey(
String keyId, String data) → Future< AppleAttestationResult> - Creates an Apple App Attestation for a given key and challenge data.
-
appleGenerateAttestationKey(
) → Future< String> - Generates a new Apple App Attestation key in the device's Secure Enclave.
-
generateUuid(
) → Future< String> - Generates a UUID using native platform implementation.
-
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 Properties
- instance ↔ CalljmpDevice
-
The default instance of CalljmpDevice to use.
getter/setter pair