| 1 | <?php |
||
| 17 | class PrivateKey implements SignatureInterface |
||
| 18 | { |
||
| 19 | /** |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | private $rawKey; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * @var resource |
||
| 26 | */ |
||
| 27 | private $resource; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * PublicKey constructor. |
||
| 31 | * @param string $privateKey Content of private key file |
||
| 32 | */ |
||
| 33 | 5 | public function __construct($privateKey) |
|
| 38 | |||
| 39 | /** |
||
| 40 | * Get a private key |
||
| 41 | * @link http://php.net/manual/en/function.openssl-pkey-get-private.php |
||
| 42 | * @return void |
||
| 43 | * @throws CertificateException An error has occurred when get private key |
||
| 44 | */ |
||
| 45 | 5 | protected function read() |
|
| 52 | |||
| 53 | /** |
||
| 54 | * {@inheritdoc} |
||
| 55 | */ |
||
| 56 | 4 | public function sign($content, $algorithm = OPENSSL_ALGO_SHA1) |
|
| 64 | |||
| 65 | public function __toString() |
||
| 69 | } |
||
| 70 |