for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/*
* This file is part of the box project.
*
* (c) Kevin Herrera <[email protected]>
* Théo Fidry <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace KevinGH\Box\Signature;
use Assert\Assertion;
/**
* Loads the private key from a file to use for verification.
abstract class PublicKey extends BufferedHash
{
* @var string The private key
private $key;
* {@inheritdoc}
final public function __construct(string $algorithm, string $path)
$keyPath = $path.'.pubkey';
Assertion::file($keyPath);
Assertion::readable($keyPath);
$this->key = file_get_contents($keyPath);
}
final protected function getKey(): string
return $this->key;