verifyBindings
Verifies the manifest's bindings (e.g., App Attest attestation). Checks the cryptographic integrity of the hardware-backed assertion.
Usage
import { VerifiableFile } from '@succinctlabs/react-native-zcam1';
const verifiable = new VerifiableFile(photoPath);
// For development/testing
const isValid = verifiable.verifyBindings(false);
// For production
const isValid = verifiable.verifyBindings(true);Parameters
appAttestProduction (required)
- Type:
boolean
Whether to verify against production App Attest environment. Use false for development/testing, true for production.
Returns
boolean - true if bindings are valid, false otherwise.
Example
import { useState } from 'react';
import { Button, Text, View, StyleSheet } from 'react-native';
import { VerifiableFile } from '@succinctlabs/react-native-zcam1';
import { launchImageLibrary } from 'react-native-image-picker';
function BindingsVerificationScreen() {
const [result, setResult] = useState<string>('');
const verifyBindings = async () => {
const response = await launchImageLibrary({ mediaType: 'photo' });
const uri = response.assets?.[0]?.uri;
if (!uri) return;
try {
const verifiable = new VerifiableFile(uri);
const isValid = verifiable.verifyBindings(false); // Use false for dev
if (isValid) {
setResult('✓ Hardware bindings verified!');
} else {
setResult('✗ Bindings verification failed');
}
} catch (error: any) {
setResult(`Error: ${error.message}`);
}
};
return (
<View style={styles.container}>
<Button title="Verify Bindings" onPress={verifyBindings} />
{result && <Text style={styles.result}>{result}</Text>}
</View>
);
}Notes
- Verifies the App Attest attestation embedded in the C2PA manifest
- The
appAttestProductionparameter must match the environment where the photo was captured - Photos captured with
ZCamerainclude hardware-backed bindings automatically - Bindings verify the authenticity of the device and key material used during capture