1 | <?php |
||
17 | class Signer |
||
18 | { |
||
19 | /** |
||
20 | * @var EcAdapterInterface |
||
21 | */ |
||
22 | private $ecAdapter; |
||
23 | |||
24 | /** |
||
25 | * @var TransactionInterface |
||
26 | */ |
||
27 | private $tx; |
||
28 | |||
29 | /** |
||
30 | * @var TransactionSignatureSerializer |
||
31 | */ |
||
32 | private $sigSerializer; |
||
33 | |||
34 | /** |
||
35 | * @var PublicKeySerializerInterface |
||
36 | */ |
||
37 | private $pubKeySerializer; |
||
38 | |||
39 | /** |
||
40 | * @var bool |
||
41 | */ |
||
42 | private $tolerateInvalidPublicKey = false; |
||
43 | |||
44 | /** |
||
45 | * @var InputSignerInterface[] |
||
46 | */ |
||
47 | private $signatureCreator = []; |
||
48 | |||
49 | /** |
||
50 | * TxWitnessSigner constructor. |
||
51 | * @param TransactionInterface $tx |
||
52 | * @param EcAdapterInterface $ecAdapter |
||
53 | */ |
||
54 | 64 | public function __construct(TransactionInterface $tx, EcAdapterInterface $ecAdapter = null) |
|
61 | |||
62 | /** |
||
63 | * @param bool $setting |
||
64 | * @return $this |
||
65 | */ |
||
66 | 2 | public function tolerateInvalidPublicKey($setting) |
|
76 | |||
77 | /** |
||
78 | * @param int $nIn |
||
79 | * @param PrivateKeyInterface $key |
||
80 | * @param TransactionOutputInterface $txOut |
||
81 | * @param SignData $signData |
||
82 | * @param int $sigHashType |
||
83 | * @return $this |
||
84 | */ |
||
85 | 50 | public function sign($nIn, PrivateKeyInterface $key, TransactionOutputInterface $txOut, SignData $signData = null, $sigHashType = SigHash::ALL) |
|
93 | |||
94 | /** |
||
95 | * @param int $nIn |
||
96 | * @param TransactionOutputInterface $txOut |
||
97 | * @param SignData|null $signData |
||
98 | * @return InputSignerInterface |
||
99 | */ |
||
100 | 64 | public function input($nIn, TransactionOutputInterface $txOut, SignData $signData = null) |
|
116 | |||
117 | /** |
||
118 | * @return TransactionInterface |
||
119 | */ |
||
120 | 50 | public function get() |
|
137 | } |
||
138 |