Capsium TypeScript API
    Preparing search index...

    Class PackageSigner

    Index
    • Sign a package directory in place: embeds publicKeyPem at signature.pub.pem, regenerates security.json (checksums plus digitalSignatures) and writes the raw RSA-SHA256 signature to signature.sig. Returns the signature file path.

      Parameters

      • dir: string
      • privateKeyPem: string
      • publicKeyPem: string

      Returns Promise<string>

    • Sign an in-memory package file map: returns a new map with the embedded public key, a regenerated security.json (checksums plus digitalSignatures) and signature.sig.

      Parameters

      • files: ReadonlyMap<string, Uint8Array<ArrayBufferLike>>
      • privateKeyPem: string
      • publicKeyPem: string

      Returns Promise<Map<string, Uint8Array<ArrayBufferLike>>>

    • Verify the declared signature of a .cap archive; throws typed errors.

      Parameters

      • capPath: string
      • OptionalpublicKeyPem: string

      Returns Promise<void>

    • Verify the declared signature of a package directory; throws typed errors.

      Parameters

      • dir: string
      • OptionalpublicKeyPem: string

      Returns Promise<void>

    • Verify the declared signature of an in-memory file map. Throws UnsignedPackageError when unsigned, SignatureError on structural problems and SignatureMismatchError on mismatch.

      Parameters

      • files: ReadonlyMap<string, Uint8Array<ArrayBufferLike>>
      • OptionalpublicKeyPem: string

      Returns Promise<void>

    • True when the file map's security.json declares digitalSignatures.

      Parameters

      • files: ReadonlyMap<string, Uint8Array<ArrayBufferLike>>

      Returns boolean