DigestAlgorithm

Backed enum for the supported message-digest algorithms. It is the single closed set for both the CMS builder and the RFC 3161 message imprint. The backing value is the lowercase algorithm name accepted by both.

Namespace: Com\Tecnick\Pdf\Sign

Backing type: string

File: DigestAlgorithm.php line 36

Backed enum for the supported message-digest algorithms. It is the single closed set for both the CMS builder and the RFC 3161 message imprint. The backing value is the lowercase algorithm name accepted by both.

Tags

Cases

Sha256

File: DigestAlgorithm.php line 38

Sha384

File: DigestAlgorithm.php line 40

Sha512

File: DigestAlgorithm.php line 42

Methods

digestLength()

File: DigestAlgorithm.php line 93

public digestLength() : int

Return values

int

fromLoose()

File: DigestAlgorithm.php line 55

public static fromLoose(string|self $value) : self

Accepts the canonical algorithm string (as validated by Config and Timestamp\Config) or an enum instance (returned unchanged). Unknown values throw, matching the closed set enforced by both configs.

Parameters

  • $value : string|self: Digest algorithm name or enum case.

Tags

  • throws: Exception if the value does not match a known digest algorithm.

Return values

self

oid()

File: DigestAlgorithm.php line 107

public oid() : string

Read by the CMS builder, the CMS reader, and the RFC 3161 request.

Return values

string

tryFromOid()

File: DigestAlgorithm.php line 79

public static tryFromOid(string $oid) : self|null

Parameters

  • $oid : string

Return values

self|null —

Null when the OID names no supported algorithm.

values()

File: DigestAlgorithm.php line 69

public static values() : array<int, string>

Return values

array<int, string>