for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of the Pixidos package.
*
* (c) Ondra Votava <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Pixidos\GPWebPay\Signer\Key;
use OpenSSLAsymmetricKey;
use Pixidos\GPWebPay\Exceptions\SignerException;
class PublicKey extends AbstractKey
{
* @throws SignerException
protected function createKey(): OpenSSLAsymmetricKey
$key = openssl_pkey_get_public($this->getContent());
if (false === $key) {
throw new SignerException(
sprintf('"%s" is not valid public key.', $this->file)
);
}
return $this->key = $key;