Table of contents
Namespace: Com\Tecnick\Pdf\Sign
final class Config
Source: src/Config.php:36
Immutable signature configuration value object. Captures the signing profile, digest algorithm, and certification level, and derives the PDF /SubFilter from the selected profile.
Constants
DIGEST_ALGORITHMS
Supported CMS digest algorithms.
Derived from DigestAlgorithm, as PROFILES is from SignatureProfile.
public const DIGEST_ALGORITHMS = [\Com\Tecnick\Pdf\Sign\DigestAlgorithm::Sha256->value, \Com\Tecnick\Pdf\Sign\DigestAlgorithm::Sha384->value, \Com\Tecnick\Pdf\Sign\DigestAlgorithm::Sha512->value]
Source: src/Config.php:86
PROFILE_LEGACY
Legacy ISO 32000-1 signature (/SubFilter /adbe.pkcs7.detached).
public const PROFILE_LEGACY = \Com\Tecnick\Pdf\Sign\SignatureProfile::Legacy->value
Source: src/Config.php:41
PROFILE_PADES_B_B
PAdES baseline B-B (CAdES-based, /SubFilter /ETSI.CAdES.detached).
public const PROFILE_PADES_B_B = \Com\Tecnick\Pdf\Sign\SignatureProfile::PadesBB->value
Source: src/Config.php:46
PROFILE_PADES_B_LT
PAdES baseline B-LT (B-T plus a Document Security Store).
public const PROFILE_PADES_B_LT = \Com\Tecnick\Pdf\Sign\SignatureProfile::PadesBLT->value
Source: src/Config.php:56
PROFILE_PADES_B_LTA
PAdES baseline B-LTA (B-LT plus a document timestamp).
public const PROFILE_PADES_B_LTA = \Com\Tecnick\Pdf\Sign\SignatureProfile::PadesBLTA->value
Source: src/Config.php:61
PROFILE_PADES_B_T
PAdES baseline B-T (B-B plus a signature timestamp).
public const PROFILE_PADES_B_T = \Com\Tecnick\Pdf\Sign\SignatureProfile::PadesBT->value
Source: src/Config.php:51
PROFILES
Supported signature profiles.
Derived from SignatureProfile, which is the closed set the constructor enforces.
public const PROFILES = [\Com\Tecnick\Pdf\Sign\SignatureProfile::Legacy->value, \Com\Tecnick\Pdf\Sign\SignatureProfile::PadesBB->value, \Com\Tecnick\Pdf\Sign\SignatureProfile::PadesBT->value, \Com\Tecnick\Pdf\Sign\SignatureProfile::PadesBLT->value, \Com\Tecnick\Pdf\Sign\SignatureProfile::PadesBLTA->value]
Source: src/Config.php:71
Properties
$certType
public $certType = 2
Source: src/Config.php:116
$digestAlgorithm
Selected CMS digest algorithm (one of the DigestAlgorithm backing values).
public string $digestAlgorithm
Source: src/Config.php:100
$profile
Selected signature profile (one of the PROFILE_* constants).
public string $profile
Source: src/Config.php:95
Methods
__construct()
public __construct(
string|SignatureProfile $profile = \self::PROFILE_LEGACY,
string|DigestAlgorithm $digestAlgorithm = 'sha256',
int $certType = 2
)
Parameters:
$profile(string|SignatureProfile): Profile identifier or enum case.$digestAlgorithm(string|DigestAlgorithm): Digest algorithm name or enum case.$certType(int): Certification level (DocMDP P value): 0 = approval/UR signature, 1 = no changes permitted, 2 = form fill-in and signing permitted, 3 = as 2 plus annotation changes.
Throws:
- Exception: If any option is invalid.
Source: src/Config.php:113
fromArray()
Build a Config from the associative-array shape used by Tcpdf::setSignature().
public static fromArray(array<string,mixed> $data): self
Parameters:
$data(array<string,mixed>): Signature options.
Returns: self
Throws:
- Exception: If any option is present but of the wrong type or value.
Source: src/Config.php:154
isPades()
True when a PAdES profile is selected.
public isPades(): bool
Returns: bool
Source: src/Config.php:134
subFilter()
PDF /SubFilter value for the selected profile.
public subFilter(): string
Returns: string
Source: src/Config.php:142