@@ 124-137 (lines=14) @@ | ||
121 | return $this; |
|
122 | } |
|
123 | ||
124 | public function setPrivateKey($prikey) |
|
125 | { |
|
126 | if (is_file($prikey)) { |
|
127 | $prikey = file_get_contents($prikey); |
|
128 | } else { |
|
129 | $prikey = $this->formatKey($prikey, 'private'); |
|
130 | } |
|
131 | ||
132 | if (!empty($prikey)) { |
|
133 | $this->setConfig('private_key', $prikey); |
|
134 | } |
|
135 | ||
136 | return $this; |
|
137 | } |
|
138 | ||
139 | public function setPublicKey($pubkey) |
|
140 | { |
|
@@ 139-150 (lines=12) @@ | ||
136 | return $this; |
|
137 | } |
|
138 | ||
139 | public function setPublicKey($pubkey) |
|
140 | { |
|
141 | if (is_file($pubkey)) { |
|
142 | $pubkey = file_get_contents($pubkey); |
|
143 | } else { |
|
144 | $pubkey = $this->formatKey($pubkey, 'public'); |
|
145 | } |
|
146 | ||
147 | $this->setConfig('public_key', $pubkey); |
|
148 | ||
149 | return $this; |
|
150 | } |
|
151 | ||
152 | public function formatKey($key, $keyType) |
|
153 | { |