Skip to content

Commit 0bcf832

Browse files
committed
feat(config): add CertConfig DTO
Signed-off-by: Vitor Mattos <vitor@php.rio>
1 parent eeb87b7 commit 0bcf832

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

src/Config/CertConfig.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
// SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
4+
// SPDX-License-Identifier: AGPL-3.0-or-later
5+
6+
declare(strict_types=1);
7+
8+
namespace LibreCodeCoop\NfsePHP\Config;
9+
10+
/**
11+
* Immutable certificate configuration for NFS-e mTLS authentication.
12+
*
13+
* Holds the contributor CNPJ, the filesystem path to the PFX bundle, and
14+
* the OpenBao KV path from which the PFX password is retrieved just-in-time.
15+
* The password is never cached across job boundaries.
16+
*/
17+
final readonly class CertConfig
18+
{
19+
public function __construct(
20+
/** CNPJ do prestador de serviço (only digits, 14 chars). */
21+
public string $cnpj,
22+
23+
/** Absolute filesystem path to the PFX certificate bundle. */
24+
public string $pfxPath,
25+
26+
/** OpenBao KV path for the PFX password (e.g. "secret/nfse/29842527000145"). */
27+
public string $vaultPath,
28+
) {
29+
}
30+
}

0 commit comments

Comments
 (0)