Merge pull request #7 from marcelloceschia/feature/redesign
add crypto lib
This commit is contained in:
0
.cache/.git_keep
Normal file
0
.cache/.git_keep
Normal file
31
lib/crypto.php
Normal file
31
lib/crypto.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SCCP\Crypto;
|
||||
|
||||
class HashAlgo // extends Enum
|
||||
{
|
||||
private const SHA1 = 0;
|
||||
private const SHA256 = 1;
|
||||
}
|
||||
|
||||
class Certificate {
|
||||
function __construct(string $file) {
|
||||
$this->file = $file;
|
||||
}
|
||||
|
||||
public function hashAsBase64(int $hashAlg) : string {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
class Crypto {
|
||||
|
||||
public static function certificateHashAsBase64(string $certificateFile, int $hashAlg) : string {
|
||||
return new Certificate($certificateFile)
|
||||
.hashAsBase64($hashAlg);
|
||||
}
|
||||
}
|
||||
|
||||
class Signer {
|
||||
}
|
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace SCCP\Resolve;
|
||||
include_once("config.php");
|
||||
include_once("utils.php");
|
||||
|
Reference in New Issue
Block a user