@majikah/majik-signature-client 0.9.2 → 0.9.3
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.
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
import { MajikKey, MajikKeyAddress } from "@majikah/majik-key";
|
|
18
18
|
import { MajikSignature, MajikSignatureEnvelope } from "@majikah/majik-signature";
|
|
19
|
-
import type { EnvelopeInfo, ExpectedSigner, MajikSignatureEnvelopeJSON, MajikSignatureJSON, MajikSignerPublicKeys, MajikTimestamp, SealInfo, SealVerificationResult, SignatoriesFilter, SignatoriesResult, SignatoryInfo, SignOptions, VerificationResult } from "@majikah/majik-signature";
|
|
19
|
+
import type { EnvelopeInfo, ExpectedSigner, FileLike, MajikSignatureEnvelopeJSON, MajikSignatureJSON, MajikSignerPublicKeys, MajikTimestamp, SealInfo, SealVerificationResult, SignatoriesFilter, SignatoriesResult, SignatoryInfo, SignOptions, VerificationResult } from "@majikah/majik-signature";
|
|
20
20
|
import { MAJIK_API_RESPONSE } from "./core/types";
|
|
21
21
|
import { ImageSignatureStub, ImageSignOptions, ImageVerificationResult } from "@majikah/majik-signature/dist/core/stamp";
|
|
22
22
|
import { MajikContactManager, MajikContactManagerAdapters } from "./core/contacts/majik-contact-manager";
|
|
@@ -497,6 +497,22 @@ export declare class MajikSignatureClient extends MajikKeyClient<MajikContact, M
|
|
|
497
497
|
mimeType?: string;
|
|
498
498
|
now?: Date;
|
|
499
499
|
}): Promise<ReturnType<typeof MajikSignature.verifyFileChain>>;
|
|
500
|
+
/**
|
|
501
|
+
* Verify a full revision chain by matching a set of supplied prior-version
|
|
502
|
+
* files against the loaded file's fileVersions history. Unlike verifyFile()
|
|
503
|
+
* (which only checks the CURRENT bytes against the latest signer),
|
|
504
|
+
* this re-hashes every supplied revision and confirms each one lines up
|
|
505
|
+
* with its recorded chain entry AND its recorded signature.
|
|
506
|
+
*
|
|
507
|
+
* @example
|
|
508
|
+
* const result = await majik.verifyFileRevisions(currentFile, [v1File, v2File]);
|
|
509
|
+
* if (!result.allValid) console.warn(result.results.filter(r => r.status !== "verified"));
|
|
510
|
+
*/
|
|
511
|
+
verifyFileRevisions(finalFile: Blob, revisions: FileLike[], options?: {
|
|
512
|
+
mimeType?: string;
|
|
513
|
+
now?: Date;
|
|
514
|
+
resolvePublicKeys?: (signerId: string) => MajikSignerPublicKeys | Promise<MajikSignerPublicKeys>;
|
|
515
|
+
}): Promise<ReturnType<typeof MajikSignature.verifyFileRevisions>>;
|
|
500
516
|
/**
|
|
501
517
|
* Verify every embedded signature in a file, each checked against its own
|
|
502
518
|
* self-reported public keys.
|
|
@@ -1333,6 +1333,26 @@ export class MajikSignatureClient extends MajikKeyClient {
|
|
|
1333
1333
|
async verifyFileChain(file, options) {
|
|
1334
1334
|
return MajikSignature.verifyFileChain(file, options);
|
|
1335
1335
|
}
|
|
1336
|
+
/**
|
|
1337
|
+
* Verify a full revision chain by matching a set of supplied prior-version
|
|
1338
|
+
* files against the loaded file's fileVersions history. Unlike verifyFile()
|
|
1339
|
+
* (which only checks the CURRENT bytes against the latest signer),
|
|
1340
|
+
* this re-hashes every supplied revision and confirms each one lines up
|
|
1341
|
+
* with its recorded chain entry AND its recorded signature.
|
|
1342
|
+
*
|
|
1343
|
+
* @example
|
|
1344
|
+
* const result = await majik.verifyFileRevisions(currentFile, [v1File, v2File]);
|
|
1345
|
+
* if (!result.allValid) console.warn(result.results.filter(r => r.status !== "verified"));
|
|
1346
|
+
*/
|
|
1347
|
+
async verifyFileRevisions(finalFile, revisions, options) {
|
|
1348
|
+
try {
|
|
1349
|
+
return await MajikSignature.verifyFileRevisions(finalFile, revisions, options);
|
|
1350
|
+
}
|
|
1351
|
+
catch (err) {
|
|
1352
|
+
this._emit("error", err, { context: "verifyFileRevisions" });
|
|
1353
|
+
throw err;
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1336
1356
|
// ── Verify ALL signatures (embedded) ──────────────────────────────────────
|
|
1337
1357
|
/**
|
|
1338
1358
|
* Verify every embedded signature in a file, each checked against its own
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@majikah/majik-signature-client",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"description": "Majik Signature Client is a hybrid post-quantum content signing and verification library for the Majikah ecosystem. Built on top of Majik Key Client, it provides tamper-proof, forgery-resistant digital signatures for any content format — using a dual-algorithm architecture that combines classical Ed25519 with post-quantum ML-DSA-87 (FIPS-204).",
|
|
5
|
-
"version": "0.9.
|
|
5
|
+
"version": "0.9.3",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"author": "Zelijah",
|
|
8
8
|
"main": "./dist/index.js",
|