@majikah/majik-signature 0.0.4 → 0.0.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.
@@ -71,7 +71,7 @@ export declare class MajikSignatureEmbed {
71
71
  */
72
72
  static verifyWithKey(file: Blob, key: MajikKey, MajikSig: MajikSignatureStaticAdapter, options?: ExtractOptions & {
73
73
  expectedSignerId?: string;
74
- }): Promise<EmbedVerifyResult>;
74
+ }, debug?: boolean): Promise<EmbedVerifyResult>;
75
75
  /**
76
76
  * Return a clean copy of the file with any embedded signature removed.
77
77
  */
@@ -155,9 +155,9 @@ export class MajikSignatureEmbed {
155
155
  * Called from MajikSignature.verifyFile() — MajikSig passed to avoid
156
156
  * circular import.
157
157
  */
158
- static async verifyWithKey(file, key, MajikSig, options) {
158
+ static async verifyWithKey(file, key, MajikSig, options, debug = false) {
159
159
  const publicKeys = MajikSig.publicKeysFromMajikKey(key);
160
- return MajikSignatureEmbed.verify(file, publicKeys, MajikSig, options);
160
+ return MajikSignatureEmbed.verify(file, publicKeys, MajikSig, options, debug);
161
161
  }
162
162
  /**
163
163
  * Return a clean copy of the file with any embedded signature removed.
@@ -142,7 +142,7 @@ export declare class MajikSignature {
142
142
  static verifyFile(file: Blob, keyOrPublicKeys: MajikKey | MajikSignerPublicKeys, options?: {
143
143
  expectedSignerId?: string;
144
144
  mimeType?: string;
145
- }): Promise<VerificationResult & {
145
+ }, debug?: boolean): Promise<VerificationResult & {
146
146
  handler?: string;
147
147
  }>;
148
148
  /**
@@ -410,13 +410,17 @@ export class MajikSignature {
410
410
  * const result = await MajikSignature.verifyFile(signedBlob, key);
411
411
  * if (result.valid) console.log("Signed by", result.signerId);
412
412
  */
413
- static async verifyFile(file, keyOrPublicKeys, options) {
413
+ static async verifyFile(file, keyOrPublicKeys, options, debug = false) {
414
414
  if (MajikSignature._isMajikKey(keyOrPublicKeys)) {
415
+ if (debug)
416
+ console.log("Verifying with MajikKey");
415
417
  return MajikSignatureEmbed.verifyWithKey(file, keyOrPublicKeys, MajikSignature, // ← adapter
416
- options);
418
+ options, debug);
417
419
  }
420
+ if (debug)
421
+ console.log("Verifying with public keys");
418
422
  return MajikSignatureEmbed.verify(file, keyOrPublicKeys, MajikSignature, // ← adapter
419
- options);
423
+ options, debug);
420
424
  }
421
425
  /**
422
426
  * Embed this MajikSignature instance into a file.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@majikah/majik-signature",
3
3
  "type": "module",
4
4
  "description": "Majik Signature is a hybrid post-quantum content signing and verification library for the Majikah ecosystem. Built on top of Majik Key, 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.0.4",
5
+ "version": "0.0.5",
6
6
  "license": "Apache-2.0",
7
7
  "author": "Zelijah",
8
8
  "main": "./dist/index.js",