Skip to content

Commit 6dbccdf

Browse files
committed
chore: make possible set the expire days
Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 7bc3013 commit 6dbccdf

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/JSignPDFTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected function setUp(): void
3434
$this->service = new JSignService();
3535
}
3636

37-
private function getNewCert($password)
37+
private function getNewCert($password, $expireDays = 365)
3838
{
3939
$privateKey = openssl_pkey_new([
4040
'private_key_bits' => 2048,
@@ -44,7 +44,7 @@ private function getNewCert($password)
4444
$csrNames = ['commonName' => 'Jhon Doe'];
4545

4646
$csr = openssl_csr_new($csrNames, $privateKey, ['digest_alg' => 'sha256']);
47-
$x509 = openssl_csr_sign($csr, null, $privateKey, 365);
47+
$x509 = openssl_csr_sign($csr, null, $privateKey, $expireDays);
4848

4949
openssl_pkcs12_export(
5050
$x509,

0 commit comments

Comments
 (0)