1 | <?php |
||
17 | class WifPrivateKeySerializer |
||
18 | { |
||
19 | /** |
||
20 | * @var Math |
||
21 | */ |
||
22 | private $math; |
||
23 | |||
24 | /** |
||
25 | * @var PrivateKeySerializerInterface |
||
26 | */ |
||
27 | private $keySerializer; |
||
28 | |||
29 | /** |
||
30 | * @param Math $math |
||
31 | * @param PrivateKeySerializerInterface $serializer |
||
32 | */ |
||
33 | 12 | public function __construct(Math $math, PrivateKeySerializerInterface $serializer) |
|
38 | |||
39 | /** |
||
40 | * @param NetworkInterface $network |
||
41 | * @param PrivateKeyInterface $privateKey |
||
42 | * @return string |
||
43 | */ |
||
44 | 8 | public function serialize(NetworkInterface $network, PrivateKeyInterface $privateKey) |
|
60 | |||
61 | /** |
||
62 | * @param string $wif |
||
63 | * @param NetworkInterface|null $network |
||
64 | * @return PrivateKeyInterface |
||
65 | * @throws Base58ChecksumFailure |
||
66 | * @throws InvalidPrivateKey |
||
67 | */ |
||
68 | 6 | public function parse($wif, NetworkInterface $network = null) |
|
90 | } |
||
91 |