@succinctlabs/react-native-zcam1 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -0
- package/Zcam1Sdk.podspec +157 -0
- package/app.plugin.js +11 -0
- package/cpp/generated/zcam1_c2pa_utils.cpp +4091 -0
- package/cpp/generated/zcam1_c2pa_utils.hpp +367 -0
- package/cpp/generated/zcam1_certs_utils.cpp +1799 -0
- package/cpp/generated/zcam1_certs_utils.hpp +72 -0
- package/cpp/generated/zcam1_verify_utils.cpp +1857 -0
- package/cpp/generated/zcam1_verify_utils.hpp +79 -0
- package/cpp/proving/generated/zcam1_proving_utils.cpp +3661 -0
- package/cpp/proving/generated/zcam1_proving_utils.hpp +275 -0
- package/cpp/proving/zcam1-proving.cpp +16 -0
- package/cpp/proving/zcam1-proving.h +15 -0
- package/cpp/zcam1-sdk.cpp +20 -0
- package/cpp/zcam1-sdk.h +15 -0
- package/ios/Zcam1Camera.swift +2945 -0
- package/ios/Zcam1CameraFilmStyle.swift +191 -0
- package/ios/Zcam1CameraViewManager.m +86 -0
- package/ios/Zcam1Capture.h +13 -0
- package/ios/Zcam1Capture.mm +500 -0
- package/ios/Zcam1DepthData.swift +417 -0
- package/ios/Zcam1Sdk.h +16 -0
- package/ios/Zcam1Sdk.mm +66 -0
- package/ios/proving/Zcam1Proving.h +16 -0
- package/ios/proving/Zcam1Proving.mm +66 -0
- package/lib/module/NativeZcam1Capture.js +12 -0
- package/lib/module/NativeZcam1Capture.js.map +1 -0
- package/lib/module/NativeZcam1Sdk.js +7 -0
- package/lib/module/NativeZcam1Sdk.js.map +1 -0
- package/lib/module/bindings.js +51 -0
- package/lib/module/bindings.js.map +1 -0
- package/lib/module/camera.js +522 -0
- package/lib/module/camera.js.map +1 -0
- package/lib/module/capture.js +120 -0
- package/lib/module/capture.js.map +1 -0
- package/lib/module/common.js +35 -0
- package/lib/module/common.js.map +1 -0
- package/lib/module/generated/zcam1_c2pa_utils-ffi.js +43 -0
- package/lib/module/generated/zcam1_c2pa_utils-ffi.js.map +1 -0
- package/lib/module/generated/zcam1_c2pa_utils.js +1202 -0
- package/lib/module/generated/zcam1_c2pa_utils.js.map +1 -0
- package/lib/module/generated/zcam1_certs_utils-ffi.js +43 -0
- package/lib/module/generated/zcam1_certs_utils-ffi.js.map +1 -0
- package/lib/module/generated/zcam1_certs_utils.js +399 -0
- package/lib/module/generated/zcam1_certs_utils.js.map +1 -0
- package/lib/module/generated/zcam1_proving_utils-ffi.js +43 -0
- package/lib/module/generated/zcam1_proving_utils-ffi.js.map +1 -0
- package/lib/module/generated/zcam1_proving_utils.js +515 -0
- package/lib/module/generated/zcam1_proving_utils.js.map +1 -0
- package/lib/module/generated/zcam1_verify_utils-ffi.js +43 -0
- package/lib/module/generated/zcam1_verify_utils-ffi.js.map +1 -0
- package/lib/module/generated/zcam1_verify_utils.js +252 -0
- package/lib/module/generated/zcam1_verify_utils.js.map +1 -0
- package/lib/module/index.js +31 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/picker.js +222 -0
- package/lib/module/picker.js.map +1 -0
- package/lib/module/proving/NativeZcam1Proving.js +7 -0
- package/lib/module/proving/NativeZcam1Proving.js.map +1 -0
- package/lib/module/proving/bindings.js +46 -0
- package/lib/module/proving/bindings.js.map +1 -0
- package/lib/module/proving/index.js +5 -0
- package/lib/module/proving/index.js.map +1 -0
- package/lib/module/proving/prove.js +346 -0
- package/lib/module/proving/prove.js.map +1 -0
- package/lib/module/utils.js +27 -0
- package/lib/module/utils.js.map +1 -0
- package/lib/module/verify.js +82 -0
- package/lib/module/verify.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeZcam1Capture.d.ts +280 -0
- package/lib/typescript/src/NativeZcam1Capture.d.ts.map +1 -0
- package/lib/typescript/src/NativeZcam1Sdk.d.ts +8 -0
- package/lib/typescript/src/NativeZcam1Sdk.d.ts.map +1 -0
- package/lib/typescript/src/bindings.d.ts +14 -0
- package/lib/typescript/src/bindings.d.ts.map +1 -0
- package/lib/typescript/src/camera.d.ts +300 -0
- package/lib/typescript/src/camera.d.ts.map +1 -0
- package/lib/typescript/src/capture.d.ts +59 -0
- package/lib/typescript/src/capture.d.ts.map +1 -0
- package/lib/typescript/src/common.d.ts +10 -0
- package/lib/typescript/src/common.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_c2pa_utils-ffi.d.ts +175 -0
- package/lib/typescript/src/generated/zcam1_c2pa_utils-ffi.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_c2pa_utils.d.ts +811 -0
- package/lib/typescript/src/generated/zcam1_c2pa_utils.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_certs_utils-ffi.d.ts +82 -0
- package/lib/typescript/src/generated/zcam1_certs_utils-ffi.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_certs_utils.d.ts +413 -0
- package/lib/typescript/src/generated/zcam1_certs_utils.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_proving_utils-ffi.d.ts +153 -0
- package/lib/typescript/src/generated/zcam1_proving_utils-ffi.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_proving_utils.d.ts +321 -0
- package/lib/typescript/src/generated/zcam1_proving_utils.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_verify_utils-ffi.d.ts +84 -0
- package/lib/typescript/src/generated/zcam1_verify_utils-ffi.d.ts.map +1 -0
- package/lib/typescript/src/generated/zcam1_verify_utils.d.ts +286 -0
- package/lib/typescript/src/generated/zcam1_verify_utils.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +29 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/picker.d.ts +103 -0
- package/lib/typescript/src/picker.d.ts.map +1 -0
- package/lib/typescript/src/proving/NativeZcam1Proving.d.ts +8 -0
- package/lib/typescript/src/proving/NativeZcam1Proving.d.ts.map +1 -0
- package/lib/typescript/src/proving/bindings.d.ts +8 -0
- package/lib/typescript/src/proving/bindings.d.ts.map +1 -0
- package/lib/typescript/src/proving/index.d.ts +3 -0
- package/lib/typescript/src/proving/index.d.ts.map +1 -0
- package/lib/typescript/src/proving/prove.d.ts +74 -0
- package/lib/typescript/src/proving/prove.d.ts.map +1 -0
- package/lib/typescript/src/utils.d.ts +2 -0
- package/lib/typescript/src/utils.d.ts.map +1 -0
- package/lib/typescript/src/verify.d.ts +45 -0
- package/lib/typescript/src/verify.d.ts.map +1 -0
- package/package.json +118 -0
- package/src/NativeZcam1Capture.ts +335 -0
- package/src/NativeZcam1Sdk.ts +10 -0
- package/src/bindings.tsx +49 -0
- package/src/camera.tsx +705 -0
- package/src/capture.tsx +165 -0
- package/src/common.tsx +46 -0
- package/src/generated/zcam1_c2pa_utils-ffi.ts +456 -0
- package/src/generated/zcam1_c2pa_utils.ts +1866 -0
- package/src/generated/zcam1_certs_utils-ffi.ts +187 -0
- package/src/generated/zcam1_certs_utils.ts +549 -0
- package/src/generated/zcam1_proving_utils-ffi.ts +374 -0
- package/src/generated/zcam1_proving_utils.ts +804 -0
- package/src/generated/zcam1_verify_utils-ffi.ts +196 -0
- package/src/generated/zcam1_verify_utils.ts +372 -0
- package/src/index.ts +73 -0
- package/src/picker.tsx +342 -0
- package/src/proving/NativeZcam1Proving.ts +10 -0
- package/src/proving/bindings.tsx +50 -0
- package/src/proving/index.ts +8 -0
- package/src/proving/prove.tsx +492 -0
- package/src/utils.ts +38 -0
- package/src/verify.tsx +119 -0
- package/turbo.json +27 -0
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import { type DeviceBindings } from "./zcam1_c2pa_utils";
|
|
2
|
+
import { type UniffiByteArray, RustBuffer, uniffiTypeNameSymbol, variantOrdinalSymbol } from "uniffi-bindgen-react-native";
|
|
3
|
+
export declare function verifyBindingsFromManifest(bindings: DeviceBindings, normalizedMetadata: string, photoHash: ArrayBuffer, production: boolean): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Wrapper around [`sp1_verifier::Groth16Verifier::verify`].
|
|
6
|
+
*
|
|
7
|
+
* We hardcode the Groth16 VK bytes to only verify SP1 proofs.
|
|
8
|
+
*/
|
|
9
|
+
export declare function verifyGroth16(proof: ArrayBuffer, publicInputs: ArrayBuffer, sp1VkHash: string): boolean;
|
|
10
|
+
export declare enum VerifyError_Tags {
|
|
11
|
+
C2pa = "C2pa",
|
|
12
|
+
AppAttest = "AppAttest",
|
|
13
|
+
Base64 = "Base64",
|
|
14
|
+
Io = "Io",
|
|
15
|
+
Groth16 = "Groth16",
|
|
16
|
+
ProofNotFound = "ProofNotFound"
|
|
17
|
+
}
|
|
18
|
+
export declare const VerifyError: {
|
|
19
|
+
C2pa: {
|
|
20
|
+
new (message: string): {
|
|
21
|
+
readonly tag: VerifyError_Tags.C2pa;
|
|
22
|
+
/**
|
|
23
|
+
* @private
|
|
24
|
+
* This field is private and should not be used.
|
|
25
|
+
*/
|
|
26
|
+
readonly [uniffiTypeNameSymbol]: string;
|
|
27
|
+
/**
|
|
28
|
+
* @private
|
|
29
|
+
* This field is private and should not be used.
|
|
30
|
+
*/
|
|
31
|
+
readonly [variantOrdinalSymbol]: 1;
|
|
32
|
+
name: string;
|
|
33
|
+
message: string;
|
|
34
|
+
stack?: string;
|
|
35
|
+
cause?: unknown;
|
|
36
|
+
};
|
|
37
|
+
instanceOf(e: any): e is {
|
|
38
|
+
readonly tag: VerifyError_Tags.C2pa;
|
|
39
|
+
/**
|
|
40
|
+
* @private
|
|
41
|
+
* This field is private and should not be used.
|
|
42
|
+
*/
|
|
43
|
+
readonly [uniffiTypeNameSymbol]: string;
|
|
44
|
+
/**
|
|
45
|
+
* @private
|
|
46
|
+
* This field is private and should not be used.
|
|
47
|
+
*/
|
|
48
|
+
readonly [variantOrdinalSymbol]: 1;
|
|
49
|
+
name: string;
|
|
50
|
+
message: string;
|
|
51
|
+
stack?: string;
|
|
52
|
+
cause?: unknown;
|
|
53
|
+
};
|
|
54
|
+
isError(error: unknown): error is Error;
|
|
55
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
56
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
57
|
+
stackTraceLimit: number;
|
|
58
|
+
};
|
|
59
|
+
AppAttest: {
|
|
60
|
+
new (message: string): {
|
|
61
|
+
readonly tag: VerifyError_Tags.AppAttest;
|
|
62
|
+
/**
|
|
63
|
+
* @private
|
|
64
|
+
* This field is private and should not be used.
|
|
65
|
+
*/
|
|
66
|
+
readonly [uniffiTypeNameSymbol]: string;
|
|
67
|
+
/**
|
|
68
|
+
* @private
|
|
69
|
+
* This field is private and should not be used.
|
|
70
|
+
*/
|
|
71
|
+
readonly [variantOrdinalSymbol]: 2;
|
|
72
|
+
name: string;
|
|
73
|
+
message: string;
|
|
74
|
+
stack?: string;
|
|
75
|
+
cause?: unknown;
|
|
76
|
+
};
|
|
77
|
+
instanceOf(e: any): e is {
|
|
78
|
+
readonly tag: VerifyError_Tags.AppAttest;
|
|
79
|
+
/**
|
|
80
|
+
* @private
|
|
81
|
+
* This field is private and should not be used.
|
|
82
|
+
*/
|
|
83
|
+
readonly [uniffiTypeNameSymbol]: string;
|
|
84
|
+
/**
|
|
85
|
+
* @private
|
|
86
|
+
* This field is private and should not be used.
|
|
87
|
+
*/
|
|
88
|
+
readonly [variantOrdinalSymbol]: 2;
|
|
89
|
+
name: string;
|
|
90
|
+
message: string;
|
|
91
|
+
stack?: string;
|
|
92
|
+
cause?: unknown;
|
|
93
|
+
};
|
|
94
|
+
isError(error: unknown): error is Error;
|
|
95
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
96
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
97
|
+
stackTraceLimit: number;
|
|
98
|
+
};
|
|
99
|
+
Base64: {
|
|
100
|
+
new (message: string): {
|
|
101
|
+
readonly tag: VerifyError_Tags.Base64;
|
|
102
|
+
/**
|
|
103
|
+
* @private
|
|
104
|
+
* This field is private and should not be used.
|
|
105
|
+
*/
|
|
106
|
+
readonly [uniffiTypeNameSymbol]: string;
|
|
107
|
+
/**
|
|
108
|
+
* @private
|
|
109
|
+
* This field is private and should not be used.
|
|
110
|
+
*/
|
|
111
|
+
readonly [variantOrdinalSymbol]: 3;
|
|
112
|
+
name: string;
|
|
113
|
+
message: string;
|
|
114
|
+
stack?: string;
|
|
115
|
+
cause?: unknown;
|
|
116
|
+
};
|
|
117
|
+
instanceOf(e: any): e is {
|
|
118
|
+
readonly tag: VerifyError_Tags.Base64;
|
|
119
|
+
/**
|
|
120
|
+
* @private
|
|
121
|
+
* This field is private and should not be used.
|
|
122
|
+
*/
|
|
123
|
+
readonly [uniffiTypeNameSymbol]: string;
|
|
124
|
+
/**
|
|
125
|
+
* @private
|
|
126
|
+
* This field is private and should not be used.
|
|
127
|
+
*/
|
|
128
|
+
readonly [variantOrdinalSymbol]: 3;
|
|
129
|
+
name: string;
|
|
130
|
+
message: string;
|
|
131
|
+
stack?: string;
|
|
132
|
+
cause?: unknown;
|
|
133
|
+
};
|
|
134
|
+
isError(error: unknown): error is Error;
|
|
135
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
136
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
137
|
+
stackTraceLimit: number;
|
|
138
|
+
};
|
|
139
|
+
Io: {
|
|
140
|
+
new (message: string): {
|
|
141
|
+
readonly tag: VerifyError_Tags.Io;
|
|
142
|
+
/**
|
|
143
|
+
* @private
|
|
144
|
+
* This field is private and should not be used.
|
|
145
|
+
*/
|
|
146
|
+
readonly [uniffiTypeNameSymbol]: string;
|
|
147
|
+
/**
|
|
148
|
+
* @private
|
|
149
|
+
* This field is private and should not be used.
|
|
150
|
+
*/
|
|
151
|
+
readonly [variantOrdinalSymbol]: 4;
|
|
152
|
+
name: string;
|
|
153
|
+
message: string;
|
|
154
|
+
stack?: string;
|
|
155
|
+
cause?: unknown;
|
|
156
|
+
};
|
|
157
|
+
instanceOf(e: any): e is {
|
|
158
|
+
readonly tag: VerifyError_Tags.Io;
|
|
159
|
+
/**
|
|
160
|
+
* @private
|
|
161
|
+
* This field is private and should not be used.
|
|
162
|
+
*/
|
|
163
|
+
readonly [uniffiTypeNameSymbol]: string;
|
|
164
|
+
/**
|
|
165
|
+
* @private
|
|
166
|
+
* This field is private and should not be used.
|
|
167
|
+
*/
|
|
168
|
+
readonly [variantOrdinalSymbol]: 4;
|
|
169
|
+
name: string;
|
|
170
|
+
message: string;
|
|
171
|
+
stack?: string;
|
|
172
|
+
cause?: unknown;
|
|
173
|
+
};
|
|
174
|
+
isError(error: unknown): error is Error;
|
|
175
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
176
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
177
|
+
stackTraceLimit: number;
|
|
178
|
+
};
|
|
179
|
+
Groth16: {
|
|
180
|
+
new (message: string): {
|
|
181
|
+
readonly tag: VerifyError_Tags.Groth16;
|
|
182
|
+
/**
|
|
183
|
+
* @private
|
|
184
|
+
* This field is private and should not be used.
|
|
185
|
+
*/
|
|
186
|
+
readonly [uniffiTypeNameSymbol]: string;
|
|
187
|
+
/**
|
|
188
|
+
* @private
|
|
189
|
+
* This field is private and should not be used.
|
|
190
|
+
*/
|
|
191
|
+
readonly [variantOrdinalSymbol]: 5;
|
|
192
|
+
name: string;
|
|
193
|
+
message: string;
|
|
194
|
+
stack?: string;
|
|
195
|
+
cause?: unknown;
|
|
196
|
+
};
|
|
197
|
+
instanceOf(e: any): e is {
|
|
198
|
+
readonly tag: VerifyError_Tags.Groth16;
|
|
199
|
+
/**
|
|
200
|
+
* @private
|
|
201
|
+
* This field is private and should not be used.
|
|
202
|
+
*/
|
|
203
|
+
readonly [uniffiTypeNameSymbol]: string;
|
|
204
|
+
/**
|
|
205
|
+
* @private
|
|
206
|
+
* This field is private and should not be used.
|
|
207
|
+
*/
|
|
208
|
+
readonly [variantOrdinalSymbol]: 5;
|
|
209
|
+
name: string;
|
|
210
|
+
message: string;
|
|
211
|
+
stack?: string;
|
|
212
|
+
cause?: unknown;
|
|
213
|
+
};
|
|
214
|
+
isError(error: unknown): error is Error;
|
|
215
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
216
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
217
|
+
stackTraceLimit: number;
|
|
218
|
+
};
|
|
219
|
+
ProofNotFound: {
|
|
220
|
+
new (message: string): {
|
|
221
|
+
readonly tag: VerifyError_Tags.ProofNotFound;
|
|
222
|
+
/**
|
|
223
|
+
* @private
|
|
224
|
+
* This field is private and should not be used.
|
|
225
|
+
*/
|
|
226
|
+
readonly [uniffiTypeNameSymbol]: string;
|
|
227
|
+
/**
|
|
228
|
+
* @private
|
|
229
|
+
* This field is private and should not be used.
|
|
230
|
+
*/
|
|
231
|
+
readonly [variantOrdinalSymbol]: 6;
|
|
232
|
+
name: string;
|
|
233
|
+
message: string;
|
|
234
|
+
stack?: string;
|
|
235
|
+
cause?: unknown;
|
|
236
|
+
};
|
|
237
|
+
instanceOf(e: any): e is {
|
|
238
|
+
readonly tag: VerifyError_Tags.ProofNotFound;
|
|
239
|
+
/**
|
|
240
|
+
* @private
|
|
241
|
+
* This field is private and should not be used.
|
|
242
|
+
*/
|
|
243
|
+
readonly [uniffiTypeNameSymbol]: string;
|
|
244
|
+
/**
|
|
245
|
+
* @private
|
|
246
|
+
* This field is private and should not be used.
|
|
247
|
+
*/
|
|
248
|
+
readonly [variantOrdinalSymbol]: 6;
|
|
249
|
+
name: string;
|
|
250
|
+
message: string;
|
|
251
|
+
stack?: string;
|
|
252
|
+
cause?: unknown;
|
|
253
|
+
};
|
|
254
|
+
isError(error: unknown): error is Error;
|
|
255
|
+
captureStackTrace(targetObject: object, constructorOpt?: Function): void;
|
|
256
|
+
prepareStackTrace(err: Error, stackTraces: NodeJS.CallSite[]): any;
|
|
257
|
+
stackTraceLimit: number;
|
|
258
|
+
};
|
|
259
|
+
instanceOf: (e: any) => e is VerifyError;
|
|
260
|
+
};
|
|
261
|
+
export type VerifyError = InstanceType<(typeof VerifyError)[keyof Omit<typeof VerifyError, "instanceOf">]>;
|
|
262
|
+
/**
|
|
263
|
+
* This should be called before anything else.
|
|
264
|
+
*
|
|
265
|
+
* It is likely that this is being done for you by the library's `index.ts`.
|
|
266
|
+
*
|
|
267
|
+
* It checks versions of uniffi between when the Rust scaffolding was generated
|
|
268
|
+
* and when the bindings were generated.
|
|
269
|
+
*
|
|
270
|
+
* It also initializes the machinery to enable Rust to talk back to Javascript.
|
|
271
|
+
*/
|
|
272
|
+
declare function uniffiEnsureInitialized(): void;
|
|
273
|
+
declare const _default: Readonly<{
|
|
274
|
+
initialize: typeof uniffiEnsureInitialized;
|
|
275
|
+
converters: {
|
|
276
|
+
FfiConverterTypeVerifyError: {
|
|
277
|
+
read(from: RustBuffer): VerifyError;
|
|
278
|
+
write(value: VerifyError, into: RustBuffer): void;
|
|
279
|
+
allocationSize(value: VerifyError): number;
|
|
280
|
+
lift(value: UniffiByteArray): VerifyError;
|
|
281
|
+
lower(value: VerifyError): UniffiByteArray;
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
}>;
|
|
285
|
+
export default _default;
|
|
286
|
+
//# sourceMappingURL=zcam1_verify_utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zcam1_verify_utils.d.ts","sourceRoot":"","sources":["../../../../src/generated/zcam1_verify_utils.ts"],"names":[],"mappings":"AAgCA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EACL,KAAK,eAAe,EAKpB,UAAU,EAKV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,6BAA6B,CAAC;AAerC,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,cAAc,EACxB,kBAAkB,EAAE,MAAM,EAC1B,SAAS,EAAE,WAAW,EACtB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G;6CAC8B,MAAM;YACvC;;;eAGG;;;;;;SAS0C;;;;;;oBAMxB,GAAG,KAAG,CAAC,IAAI,WAAW;CAY3C,CAAC;AAIL,MAAM,MAAM,WAAW,GAAG,YAAY,CACpC,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,IAAI,CAAC,OAAO,WAAW,EAAE,YAAY,CAAC,CAAC,CACnE,CAAC;AA0CF;;;;;;;;;GASG;AACH,iBAAS,uBAAuB,SAyB/B;;;;;uBAvEc,UAAU;4CAwBQ,UAAU,GAAG,IAAI;gDAKb,MAAM;;;;;;AA4C3C,wBAKG"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export type { ManifestEditorInterface, ManifestInterface, ManifestStoreInterface, } from "./bindings";
|
|
2
|
+
export { AuthenticityData, AuthenticityStatus, authenticityStatus, buildSelfSignedCertificate, C2paError, C2paError_Tags, Claim, computeHash, computeHashFromBuffer, DepthData, DepthDataStatistics, DeviceBindings, Exclusion, extractManifest, FilmStyleInfo, formatFromPath, Manifest, ManifestEditor, ManifestStore, PhotoMetadataInfo, Proof, SelfSignedCertChain, VerifyError, VerifyError_Tags, VideoMetadataInfo, } from "./bindings";
|
|
3
|
+
/**
|
|
4
|
+
* Camera component for capturing photos with secure enclave integration.
|
|
5
|
+
*/
|
|
6
|
+
export type { CameraFilmStyle, CaptureFormat, FilmStyleEffect, FilmStyleRecipe, HighlightShadowConfig, MonochromeConfig, TakePhotoOptions, WhiteBalanceConfig, ZCameraProps, } from "./camera";
|
|
7
|
+
export { ZCamera } from "./camera";
|
|
8
|
+
export type { CaptureInfo, DeviceOrientation } from "./capture";
|
|
9
|
+
export { initCapture } from "./capture";
|
|
10
|
+
/**
|
|
11
|
+
* Core cryptographic key types and secure enclave utilities.
|
|
12
|
+
*/
|
|
13
|
+
export type { ECKey } from "./common";
|
|
14
|
+
export { getContentPublicKey, getSecureEnclaveKeyId } from "./common";
|
|
15
|
+
export type { PhotoGallery, PrivateFolder, ZImagePickerProps } from "./picker";
|
|
16
|
+
/**
|
|
17
|
+
* Image picker and private directory utilities for secure media selection.\
|
|
18
|
+
*/
|
|
19
|
+
export { privateDirectory, ZImagePicker } from "./picker";
|
|
20
|
+
/**
|
|
21
|
+
* Verification utilities for validating media authenticity and capture metadata.
|
|
22
|
+
|
|
23
|
+
*/
|
|
24
|
+
export { type CaptureMetadata, VerifiableFile } from "./verify";
|
|
25
|
+
/**
|
|
26
|
+
* Flash mode for photo capture.
|
|
27
|
+
*/
|
|
28
|
+
export { type FlashMode } from "./NativeZcam1Capture";
|
|
29
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,0BAA0B,EAC1B,SAAS,EACT,cAAc,EACd,KAAK,EACL,WAAW,EACX,qBAAqB,EACrB,SAAS,EACT,mBAAmB,EACnB,cAAc,EACd,SAAS,EACT,eAAe,EACf,aAAa,EACb,cAAc,EACd,QAAQ,EACR,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,KAAK,EACL,mBAAmB,EACnB,WAAW,EACX,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,YAAY,EACV,eAAe,EACf,aAAa,EACb,eAAe,EACf,eAAe,EACf,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,GACb,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAExC;;GAEG;AACH,YAAY,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACtE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE/E;;GAEG;AACH,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE1D;;;GAGG;AACH,OAAO,EAAE,KAAK,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEhE;;GAEG;AACH,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { AuthenticityStatus } from "./bindings";
|
|
2
|
+
/**
|
|
3
|
+
* Configuration for loading images from a private folder.
|
|
4
|
+
*/
|
|
5
|
+
export interface PrivateFolder {
|
|
6
|
+
/**
|
|
7
|
+
* The file system path to the private folder containing images.
|
|
8
|
+
*/
|
|
9
|
+
path: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Configuration for loading images from the device's photo gallery.
|
|
13
|
+
*/
|
|
14
|
+
export interface PhotoGallery {
|
|
15
|
+
/**
|
|
16
|
+
* The name of the album to load images from.
|
|
17
|
+
*/
|
|
18
|
+
album?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Props for the ZImagePicker component.
|
|
22
|
+
*/
|
|
23
|
+
export interface ZImagePickerProps {
|
|
24
|
+
/**
|
|
25
|
+
* The source from which to load images. Can be either a PrivateFolder or PhotoGallery.
|
|
26
|
+
*/
|
|
27
|
+
source: PrivateFolder | PhotoGallery;
|
|
28
|
+
/**
|
|
29
|
+
* Change this value to force the picker to reload images.
|
|
30
|
+
* Useful when the underlying folder/album contents may have changed
|
|
31
|
+
* while this screen stayed mounted.
|
|
32
|
+
*/
|
|
33
|
+
refreshToken?: string | number;
|
|
34
|
+
/**
|
|
35
|
+
* Whether to start rendering images from the bottom of the list.
|
|
36
|
+
* Defaults to false (renders from top).
|
|
37
|
+
*/
|
|
38
|
+
renderFromBottom?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Sort order for images.
|
|
41
|
+
* Defaults to 'oldest-first' (oldest images first in the list).
|
|
42
|
+
*/
|
|
43
|
+
sortOrder?: "newest-first" | "oldest-first";
|
|
44
|
+
/**
|
|
45
|
+
* Optional function to render a badge based on the authenticity status of an image.
|
|
46
|
+
* @param status - The authenticity status of the image.
|
|
47
|
+
* @returns A React element to display as a badge, or null to display nothing.
|
|
48
|
+
*/
|
|
49
|
+
renderBadge?: (uri: string, status: AuthenticityStatus) => React.ReactElement | null;
|
|
50
|
+
/**
|
|
51
|
+
* Optional callback function that is called when an image is selected.
|
|
52
|
+
* @param uri - The URI of the selected image.
|
|
53
|
+
*/
|
|
54
|
+
onSelect?: (uri: string) => void;
|
|
55
|
+
/**
|
|
56
|
+
* Enable multi-selection mode.
|
|
57
|
+
* Defaults to false (single-selection mode).
|
|
58
|
+
*/
|
|
59
|
+
multiSelect?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Array of currently selected image URIs. Only used when multiSelect is true.
|
|
62
|
+
*/
|
|
63
|
+
selectedUris?: string[];
|
|
64
|
+
/**
|
|
65
|
+
* Optional callback function that is called when the selection changes in multi-select mode.
|
|
66
|
+
* @param uris - Array of currently selected image URIs.
|
|
67
|
+
*/
|
|
68
|
+
onSelectionChange?: (uris: string[]) => void;
|
|
69
|
+
/**
|
|
70
|
+
* Optional function to render a selection overlay when an image is selected in multi-select mode.
|
|
71
|
+
* @param uri - The URI of the image.
|
|
72
|
+
* @param isSelected - Whether the image is currently selected.
|
|
73
|
+
* @returns A React element to display as a selection overlay, or null to display nothing.
|
|
74
|
+
*/
|
|
75
|
+
renderSelectionOverlay?: (uri: string, isSelected: boolean) => React.ReactElement | null;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Returns the path to the app's private document directory.
|
|
79
|
+
* @returns {string} The path to the private document directory.
|
|
80
|
+
*/
|
|
81
|
+
export declare function privateDirectory(): string;
|
|
82
|
+
/**
|
|
83
|
+
* A component that displays a grid of images from either a private folder or photo gallery.
|
|
84
|
+
* Each image can display an authenticity badge and be selected by the user.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```tsx
|
|
88
|
+
* // Load from private folder
|
|
89
|
+
* <ZImagePicker
|
|
90
|
+
* source={{ path: privateDirectory() }}
|
|
91
|
+
* renderBadge={(status) => <Badge status={status} />}
|
|
92
|
+
* onSelect={(uri) => console.log('Selected:', uri)}
|
|
93
|
+
* />
|
|
94
|
+
*
|
|
95
|
+
* // Load from photo gallery album
|
|
96
|
+
* <ZImagePicker
|
|
97
|
+
* source={{ album: 'MyAlbum' }}
|
|
98
|
+
* onSelect={(uri) => console.log('Selected:', uri)}
|
|
99
|
+
* />
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
export declare const ZImagePicker: (props: ZImagePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
103
|
+
//# sourceMappingURL=picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"picker.d.ts","sourceRoot":"","sources":["../../../src/picker.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,kBAAkB,EAAsB,MAAM,YAAY,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,MAAM,EAAE,aAAa,GAAG,YAAY,CAAC;IAErC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE/B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,cAAc,GAAG,cAAc,CAAC;IAE5C;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,kBAAkB,KAAK,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;IAErF;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAEjC;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IAE7C;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,KAAK,KAAK,CAAC,YAAY,GAAG,IAAI,CAAC;CAC1F;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAiFD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,iBAAiB,4CA4HpD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TurboModule } from "react-native";
|
|
2
|
+
export interface Spec extends TurboModule {
|
|
3
|
+
installRustCrate(): boolean;
|
|
4
|
+
cleanupRustCrate(): boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: Spec | null;
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=NativeZcam1Proving.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeZcam1Proving.d.ts","sourceRoot":"","sources":["../../../../src/proving/NativeZcam1Proving.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGhD,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,gBAAgB,IAAI,OAAO,CAAC;IAC5B,gBAAgB,IAAI,OAAO,CAAC;CAC7B;;AAED,wBAA6D"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./../generated/zcam1_proving_utils";
|
|
2
|
+
import * as zcam1_proving_utils from "./../generated/zcam1_proving_utils";
|
|
3
|
+
export declare function uniffiInitAsync(): Promise<void>;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
zcam1_proving_utils: typeof zcam1_proving_utils;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=bindings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bindings.d.ts","sourceRoot":"","sources":["../../../../src/proving/bindings.tsx"],"names":[],"mappings":"AAuBA,cAAc,oCAAoC,CAAC;AAKnD,OAAO,KAAK,mBAAmB,MAAM,oCAAoC,CAAC;AAc1E,wBAAsB,eAAe,kBAEpC;;;;AAGD,wBAEE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/proving/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACjE,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,SAAS,GACV,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ExistingCertChain, SelfSignedCertChain } from "../bindings";
|
|
3
|
+
import { FulfillmentStatus, type IosProvingClientInterface, ProofRequestStatus, ProverNetworkMode } from "./bindings";
|
|
4
|
+
export { ProverNetworkMode } from "./bindings";
|
|
5
|
+
/**
|
|
6
|
+
* Configuration settings for backend communication.
|
|
7
|
+
*/
|
|
8
|
+
export type Settings = {
|
|
9
|
+
/** Private key used to authenticate with the prover network. If omitted, a mock prover is used. */
|
|
10
|
+
privateKey?: string;
|
|
11
|
+
/** Certificate chain used to sign C2PA manifests. If omitted, a self signed certificate chain.is build using default values */
|
|
12
|
+
certChain?: SelfSignedCertChain | ExistingCertChain;
|
|
13
|
+
/** Whether to target the production environment. */
|
|
14
|
+
production: boolean;
|
|
15
|
+
/** Prover network mode (mainnet or reserved capacity). Defaults to `Reserved`. */
|
|
16
|
+
proverNetworkMode?: ProverNetworkMode;
|
|
17
|
+
};
|
|
18
|
+
export type ProverContextValue = {
|
|
19
|
+
provingClient: ProvingClient | null;
|
|
20
|
+
provingTasks: ProvingTasksState;
|
|
21
|
+
provingTasksCount: number;
|
|
22
|
+
isInitializing: boolean;
|
|
23
|
+
error: unknown;
|
|
24
|
+
};
|
|
25
|
+
export type ProofRequestContextValue = {
|
|
26
|
+
isInitializing: boolean;
|
|
27
|
+
error: unknown;
|
|
28
|
+
fulfillementStatus: FulfillmentStatus;
|
|
29
|
+
proof: ArrayBuffer | undefined;
|
|
30
|
+
};
|
|
31
|
+
export type ProvingTask = {
|
|
32
|
+
photoPath: string;
|
|
33
|
+
createdAtMs: number;
|
|
34
|
+
};
|
|
35
|
+
export type ProvingTasksState = Record<string, ProvingTask>;
|
|
36
|
+
export type ProverProviderProps = {
|
|
37
|
+
children: React.ReactNode;
|
|
38
|
+
/**
|
|
39
|
+
* Provider configuration. The provider always initializes itself from these settings.
|
|
40
|
+
*/
|
|
41
|
+
settings: Settings;
|
|
42
|
+
onFulfilled?: (requestId: string, photoPath: string, proof: ArrayBuffer, provingClient: ProvingClient) => void;
|
|
43
|
+
onUnfulfillable?: (requestId: string) => void;
|
|
44
|
+
};
|
|
45
|
+
export declare function ProverProvider({ children, settings, onFulfilled, onUnfulfillable, }: ProverProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export declare function useProver(): ProverContextValue;
|
|
47
|
+
export declare function useProofRequestStatus(requestId: string | null): ProofRequestContextValue;
|
|
48
|
+
export declare class ProvingClient {
|
|
49
|
+
client: IosProvingClientInterface;
|
|
50
|
+
contentKeyId: Uint8Array;
|
|
51
|
+
certChainPem: string;
|
|
52
|
+
production: boolean;
|
|
53
|
+
onProofRequest?: (requestId: string, photoPath: string) => void;
|
|
54
|
+
constructor(client: IosProvingClientInterface, contentKeyId: Uint8Array, certChainPem: string, production: boolean, onProofRequest?: (requestId: string, photoPath: string) => void);
|
|
55
|
+
/**
|
|
56
|
+
* Embeds a cryptographic proof into an image file by modifying its C2PA manifest.
|
|
57
|
+
* @param originalPath - Path to the original image file
|
|
58
|
+
* @param deviceInfo - Device information for signing
|
|
59
|
+
* @param settings - Configuration settings for proof generation
|
|
60
|
+
* @returns Request ID for polling proof status
|
|
61
|
+
*/
|
|
62
|
+
requestProof(originalPath: string): Promise<string>;
|
|
63
|
+
getProofStatus(requestId: string): Promise<ProofRequestStatus>;
|
|
64
|
+
/**
|
|
65
|
+
* Embeds a cryptographic proof into an image file by modifying its C2PA manifest.
|
|
66
|
+
* @param originalPath - Path to the original image file
|
|
67
|
+
* @param deviceInfo - Device information for signing
|
|
68
|
+
* @param settings - Configuration settings for proof generation
|
|
69
|
+
* @returns Path to the new file with embedded proof
|
|
70
|
+
*/
|
|
71
|
+
embedProof(originalPath: string, proof: ArrayBuffer): Promise<string>;
|
|
72
|
+
waitAndEmbedProof(originalPath: string): Promise<string>;
|
|
73
|
+
}
|
|
74
|
+
//# sourceMappingURL=prove.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prove.d.ts","sourceRoot":"","sources":["../../../../src/proving/prove.tsx"],"names":[],"mappings":"AACA,OAAO,KAQN,MAAM,OAAO,CAAC;AAGf,OAAO,EAEL,iBAAiB,EAGjB,mBAAmB,EACpB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,iBAAiB,EAGjB,KAAK,yBAAyB,EAC9B,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAE/C;;GAEG;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adataInfo, VideoMetadataInfo } from "./bindings";
|
|
2
|
+
/**
|
|
3
|
+
* Capture metadata extracted from the C2PA manifest.
|
|
4
|
+
* Contains device info and camera settings at capture time.
|
|
5
|
+
*/
|
|
6
|
+
export interface CaptureMetadata {
|
|
7
|
+
action: string;
|
|
8
|
+
when: string;
|
|
9
|
+
parameters: PhotoMetadataInfo | VideoMetadataInfo;
|
|
10
|
+
}
|
|
11
|
+
export declare const APPLE_ROOT_CERT = "MIICITCCAaegAwIBAgIQC/O+DvHN0uD7jG5yH2IXmDAKBggqhkjOPQQDAzBSMSYwJAYDVQQDDB1BcHBsZSBBcHAgQXR0ZXN0YXRpb24gUm9vdCBDQTETMBEGA1UECgwKQXBwbGUgSW5jLjETMBEGA1UECAwKQ2FsaWZvcm5pYTAeFw0yMDAzMTgxODMyNTNaFw00NTAzMTUwMDAwMDBaMFIxJjAkBgNVBAMMHUFwcGxlIEFwcCBBdHRlc3RhdGlvbiBSb290IENBMRMwEQYDVQQKDApBcHBsZSBJbmMuMRMwEQYDVQQIDApDYWxpZm9ybmlhMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAERTHhmLW07ATaFQIEVwTtT4dyctdhNbJhFs/Ii2FdCgAHGbpphY3+d8qjuDngIN3WVhQUBHAoMeQ/cLiP1sOUtgjqK9auYen1mMEvRq9Sk3Jm5X8U62H+xTD3FE9TgS41o0IwQDAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSskRBTM72+aEH/pwyp5frq5eWKoTAOBgNVHQ8BAf8EBAMCAQYwCgYIKoZIzj0EAwMDaAAwZQIwQgFGnByvsiVbpTKwSga0kP0e8EeDS4+sQmTvb7vn53O5+FRXgeLhpJ06ysC5PrOyAjEAp5U4xDgEgllF7En3VcE3iexZZtKeYnpqtijVoyFraWVIyd/dganmrduC1bmTBGwD";
|
|
12
|
+
/**
|
|
13
|
+
* Represents a file with a C2PA manifest that can be verified for authenticity.
|
|
14
|
+
*/
|
|
15
|
+
export declare class VerifiableFile {
|
|
16
|
+
path: string;
|
|
17
|
+
activeManifest: ManifestInterface;
|
|
18
|
+
hash: ArrayBuffer | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Creates a VerifiableFile instance by extracting the C2PA manifest from the file.
|
|
21
|
+
* @param path - Path to the file to verify
|
|
22
|
+
*/
|
|
23
|
+
constructor(path: string);
|
|
24
|
+
/**
|
|
25
|
+
* Verifies the manifest's bindings (e.g., App Attest).
|
|
26
|
+
*/
|
|
27
|
+
verifyBindings(appAttestProduction: boolean): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Verifies the cryptographic proof embedded in the C2PA manifest.
|
|
30
|
+
* @returns True if the proof is valid, false otherwise
|
|
31
|
+
*/
|
|
32
|
+
verifyProof(appId: string): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the file's content hash as recorded in the active C2PA manifest.
|
|
35
|
+
* @returns The manifest data hash (base64-encoded string)
|
|
36
|
+
*/
|
|
37
|
+
dataHash(): string | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the capture metadata from the C2PA manifest.
|
|
40
|
+
* Contains device info and camera settings recorded at capture time.
|
|
41
|
+
* @returns The capture metadata, or null if not present
|
|
42
|
+
*/
|
|
43
|
+
captureMetadata(): CaptureMetadata | null;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/verify.tsx"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,iBAAiB,EACtB,iBAAiB,EAGjB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,iBAAiB,GAAG,iBAAiB,CAAC;CACnD;AAED,eAAO,MAAM,eAAe,iuBACosB,CAAC;AAEjuB;;GAEG;AACH,qBAAa,cAAc;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,iBAAiB,CAAC;IAClC,IAAI,EAAE,WAAW,GAAG,SAAS,CAAC;IAE9B;;;OAGG;gBACS,IAAI,EAAE,MAAM;IAOxB;;OAEG;IACH,cAAc,CAAC,mBAAmB,EAAE,OAAO,GAAG,OAAO;IAarD;;;OAGG;IACH,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAInC;;;OAGG;IACH,QAAQ,IAAI,MAAM,GAAG,SAAS;IAQ9B;;;;OAIG;IACH,eAAe,IAAI,eAAe,GAAG,IAAI;CAK1C"}
|