External

Fluent sub-facade for the external / remote signing workflow, reached through Tcpdf::signature()->external().

Namespace: Com\Tecnick\Pdf\Signature

final class External

Source: src/Signature/External.php:40

Fluent sub-facade for the external / remote signing workflow, reached through Tcpdf::signature()->external(). It forwards to the existing external-signing methods on Tcpdf.

Methods

__construct()

public __construct(Tcpdf $pdf)

Parameters:

Source: src/Signature/External.php:42

apply()

Inject an externally generated CMS/PKCS#7 signature into a prepared document.

public apply(
    string $preparedPdf,
    array{int, int, int, int} $byteRange,
    string $signature,
    string|ExternalSignatureEncoding $encoding = 'binary'
): string

Parameters:

  • $preparedPdf (string): Prepared PDF returned by prepare().
  • $byteRange (array{int, int, int, int}): ByteRange returned by prepare().
  • $signature (string): External signature data.
  • $encoding (string|ExternalSignatureEncoding): Signature encoding: binary, base64, hex, or enum case.

Returns: string: Fully signed PDF document.

Throws:

Source: src/Signature/External.php:93

configure()

Reserve the signature placeholder for external signing without a local key.

public configure(TSignature $data): self

Parameters:

  • $data (TSignature): Signature configuration (signcert/privkey may be empty).

Returns: self

Throws:

Source: src/Signature/External.php:53

prepare()

Build the document for external signing and compute the ByteRange digest.

public prepare(string $algorithm = 'sha256'): array{algorithm: string, byte_range: array{int, int, int, int}, prepared_pdf: string, hash_raw: string, hash_hex: string, hash_base64: string}

Parameters:

  • $algorithm (string): Hash algorithm accepted by hash() (default: sha256).

Returns: array{algorithm: string, byte_range: array{int, int, int, int}, prepared_pdf: string, hash_raw: string, hash_hex: string, hash_base64: string}

Throws:

Source: src/Signature/External.php:76