Skip to content

Commit

Permalink
move KeyPair class to Helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
pavarnos committed Aug 14, 2018
1 parent b97fca8 commit f9ce8d4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/Threema/MsgApi/Encryptor/AbstractEncryptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,13 @@
namespace Threema\MsgApi\Encryptor;

use Threema\Core\AssocArray;
use Threema\Core\KeyPair;
use Threema\MsgApi\Commands\Results\UploadFileResult;
use Threema\MsgApi\Exceptions\BadMessageException;
use Threema\MsgApi\Exceptions\DecryptionFailedException;
use Threema\MsgApi\Exceptions\Exception;
use Threema\MsgApi\Exceptions\UnsupportedMessageTypeException;
use Threema\MsgApi\Helpers\EncryptResult;
use Threema\MsgApi\Helpers\FileAnalysisResult;
use Threema\MsgApi\Helpers\KeyPair;
use Threema\MsgApi\Messages\DeliveryReceipt;
use Threema\MsgApi\Messages\FileMessage;
use Threema\MsgApi\Messages\ImageMessage;
Expand Down
3 changes: 1 addition & 2 deletions src/Threema/MsgApi/Encryptor/SodiumEncryptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

namespace Threema\MsgApi\Encryptor;

use Threema\Core\KeyPair;
use Threema\MsgApi\Exceptions\Exception;
use Threema\MsgApi\Helpers\KeyPair;

/**
* Contains static methods to do various Threema cryptography related tasks.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
* @copyright Copyright (c) 2015-2016 Threema GmbH
*/

namespace Threema\Core;
namespace Threema\MsgApi\Helpers;

class KeyPair
{
/** @var string */
public $privateKey;
private $privateKey;

/** @var string */
public $publicKey;
private $publicKey;

public function __construct(string $privateKey, string $publicKey)
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Threema/Console/Symfony/EncryptDecryptTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Tester\CommandTester;
use Threema\Core\KeyPair;
use Threema\MsgApi\ConnectionFactory;
use Threema\MsgApi\Constants;
use Threema\MsgApi\Helpers\KeyPair;

class EncryptDecryptTest extends TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Threema/MsgApi/EncryptorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public function testCreateKeyPair(AbstractEncryptor $encryptor, string $prefix)
$this->assertNotNull($encryptor, $prefix . ' could not instance crypto tool');
$keyPair = $encryptor->generateKeyPair();
$this->assertNotNull($keyPair, $prefix . ': invalid key pair');
$this->assertNotNull($keyPair->privateKey, $prefix . ': private key is null');
$this->assertNotNull($keyPair->publicKey, $prefix . ': public key is null');
$this->assertNotNull($keyPair->getPrivateKey(), $prefix . ': private key is null');
$this->assertNotNull($keyPair->getPublicKey(), $prefix . ': public key is null');
}

/**
Expand Down

0 comments on commit f9ce8d4

Please sign in to comment.