Capsium TypeScript API
    Preparing search index...

    Class PackageCipher

    Index
    • Decrypt an encrypted .cap file, writing the inner .cap to outPath.

      Parameters

      • capPath: string
      • privateKeyPem: string
      • outPath: string

      Returns Promise<void>

    • Decrypt encrypted .cap bytes into the inner .cap bytes.

      Parameters

      • encBytes: Uint8Array
      • privateKeyPem: string

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • Decrypt an unpacked §6b envelope file map into the inner .cap bytes.

      Parameters

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

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • Encrypt a package into the §6b envelope: packagePath may be a package directory (packed first, so checksums are in place) or a .cap file. Writes the encrypted .cap to outPath.

      Parameters

      • packagePath: string
      • publicKeyPem: string
      • outPath: string

      Returns Promise<void>

    • Encrypt .cap bytes into the §6b envelope layout (as zip bytes).

      Parameters

      • capBytes: Uint8Array
      • publicKeyPem: string

      Returns Promise<Uint8Array<ArrayBufferLike>>

    • Encrypt a directory or .cap into encrypted .cap bytes (§6b).

      Parameters

      • packagePath: string
      • publicKeyPem: string

      Returns Promise<Uint8Array<ArrayBufferLike>>