|
@@ 107-109 (lines=3) @@
|
| 104 |
|
$encryptionResult = $this->cryptTool->encryptImage(file_get_contents($imagePath), $this->privateKey, $receiverPublicKey); |
| 105 |
|
$uploadResult = $this->connection->uploadFile($encryptionResult->getData()); |
| 106 |
|
|
| 107 |
|
if($uploadResult === null || !$uploadResult->isSuccess()) { |
| 108 |
|
throw new Exception('could not upload the image ('.$uploadResult->getErrorCode().' '.$uploadResult->getErrorMessage().') '.$uploadResult->getRawResponse()); |
| 109 |
|
} |
| 110 |
|
|
| 111 |
|
$nonce = $this->cryptTool->randomNonce(); |
| 112 |
|
|
|
@@ 150-152 (lines=3) @@
|
| 147 |
|
$encryptionResult = $this->cryptTool->encryptFile(file_get_contents($filePath)); |
| 148 |
|
$uploadResult = $this->connection->uploadFile($encryptionResult->getData()); |
| 149 |
|
|
| 150 |
|
if($uploadResult === null || !$uploadResult->isSuccess()) { |
| 151 |
|
throw new Exception('could not upload the file ('.$uploadResult->getErrorCode().' '.$uploadResult->getErrorMessage().') '.$uploadResult->getRawResponse()); |
| 152 |
|
} |
| 153 |
|
|
| 154 |
|
$thumbnailUploadResult = null; |
| 155 |
|
|
|
@@ 162-164 (lines=3) @@
|
| 159 |
|
$thumbnailEncryptionResult = $this->cryptTool->encryptFileThumbnail(file_get_contents($thumbnailPath), $encryptionResult->getKey()); |
| 160 |
|
$thumbnailUploadResult = $this->connection->uploadFile($thumbnailEncryptionResult->getData()); |
| 161 |
|
|
| 162 |
|
if($thumbnailUploadResult === null || !$thumbnailUploadResult->isSuccess()) { |
| 163 |
|
throw new Exception('could not upload the thumbnail file ('.$thumbnailUploadResult->getErrorCode().' '.$thumbnailUploadResult->getErrorMessage().') '.$thumbnailUploadResult->getRawResponse()); |
| 164 |
|
} |
| 165 |
|
} |
| 166 |
|
|
| 167 |
|
$nonce = $this->cryptTool->randomNonce(); |