From 4e18aa6e57cc9ac7e615715cab537253e8a850f9 Mon Sep 17 00:00:00 2001 From: Robinson Garcia Date: Sun, 3 Apr 2022 20:20:19 -0500 Subject: [PATCH] allowing stream entry --- TotusPKI/Certificate.php | 7 ++++++- TotusPKI/ElementoPKI.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/TotusPKI/Certificate.php b/TotusPKI/Certificate.php index 3e48626..684b7c0 100644 --- a/TotusPKI/Certificate.php +++ b/TotusPKI/Certificate.php @@ -8,7 +8,12 @@ class Certificate { private $encriptedPrivateKey; private $privateKey; - public function __construct(string $cer, string $key = null, string $password = null) { + /** + * @param string|stream $cer path to the cer file or the read data of the file + * @param string|stream $key path to the key file or the read data of the file + * @param string $password passphrase must be used to the specified key is encrypted + */ + public function __construct($cer, $key = null, string $password = null) { $this->publicKey = new PublicKey($cer); if (isset($key)) { $this->encriptedPrivateKey = new EncriptedPrivateKey($key, $password); diff --git a/TotusPKI/ElementoPKI.php b/TotusPKI/ElementoPKI.php index c424e51..14f6f5e 100644 --- a/TotusPKI/ElementoPKI.php +++ b/TotusPKI/ElementoPKI.php @@ -6,7 +6,7 @@ abstract class ElementoPKI implements IElementoPKI { protected $name; protected $data; - public function __construct(string $name, string $data) { + public function __construct($name, $data) { $this->name = $name; $data = @is_file($data) ? file_get_contents($data) : $data;