1 | <?php |
||
16 | class PrivateKeySerializer implements PrivateKeySerializerInterface |
||
17 | { |
||
18 | /** |
||
19 | * @var EcAdapter |
||
20 | */ |
||
21 | private $ecAdapter; |
||
22 | |||
23 | /** |
||
24 | * @param EcAdapter $ecAdapter |
||
25 | */ |
||
26 | 83 | public function __construct(EcAdapter $ecAdapter) |
|
30 | |||
31 | /** |
||
32 | * @param PrivateKey $privateKey |
||
33 | * @return BufferInterface |
||
34 | */ |
||
35 | 68 | private function doSerialize(PrivateKey $privateKey) |
|
39 | |||
40 | /** |
||
41 | * @param PrivateKeyInterface $privateKey |
||
42 | * @return BufferInterface |
||
43 | */ |
||
44 | 68 | public function serialize(PrivateKeyInterface $privateKey) |
|
49 | |||
50 | /** |
||
51 | * @param Parser $parser |
||
52 | * @return PrivateKey |
||
53 | * @throws \BitWasp\Buffertools\Exceptions\ParserOutOfRange |
||
54 | */ |
||
55 | 40 | public function fromParser(Parser $parser) |
|
59 | |||
60 | /** |
||
61 | * @param \BitWasp\Buffertools\BufferInterface|string $data |
||
62 | * @return PrivateKey |
||
63 | */ |
||
64 | 40 | public function parse($data) |
|
68 | } |
||
69 |