Adopted composer autoload way

Split up classes into separate way, to allow autoloader to do it's work

Signed-off-by: Diederik de Groot <ddegroot@talon.nl>
This commit is contained in:
Diederik de Groot
2020-03-22 10:15:31 +01:00
parent fcf7e52370
commit 5064cb3e36
34 changed files with 1292 additions and 1023 deletions

View File

@@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace PROVISION\Crypto;
class Certificate {
function __construct(string $file) {
$this->file = $file;
}
public function hashAsBase64(int $hashAlg) : string {
return "";
}
}
?>

12
lib/Crypto/Crypto.php Normal file
View File

@@ -0,0 +1,12 @@
<?php
declare(strict_types=1);
namespace PROVISION\Crypto;
class Crypto {
public static function certificateHashAsBase64(string $certificateFile, int $hashAlg) : string {
return new Certificate($certificateFile)
.hashAsBase64($hashAlg);
}
}

11
lib/Crypto/HashAlgo.php Normal file
View File

@@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
namespace PROVISION\Crypto;
class HashAlgo // extends Enum
{
private const SHA1 = 0;
private const SHA256 = 1;
}
?>

8
lib/Crypto/Signer.php Normal file
View File

@@ -0,0 +1,8 @@
<?php
declare(strict_types=1);
namespace PROVISION\Signer;
class Signer {
}
?>