Made message signing in Cryptography use SHA512 as the message content for... #1
1 changed files with 30 additions and 1 deletions
|
@ -3,6 +3,7 @@
|
||||||
namespace Socialbox\Objects\Standard;
|
namespace Socialbox\Objects\Standard;
|
||||||
|
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
|
use Socialbox\Enums\Flags\PeerFlags;
|
||||||
use Socialbox\Interfaces\SerializableInterface;
|
use Socialbox\Interfaces\SerializableInterface;
|
||||||
use Socialbox\Objects\Database\PeerInformationFieldRecord;
|
use Socialbox\Objects\Database\PeerInformationFieldRecord;
|
||||||
use Socialbox\Objects\PeerAddress;
|
use Socialbox\Objects\PeerAddress;
|
||||||
|
@ -66,7 +67,35 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->informationFields = $informationFields;
|
$this->informationFields = $informationFields;
|
||||||
$this->flags = $data['flags'];
|
|
||||||
|
if(is_array($data['flags']))
|
||||||
|
{
|
||||||
|
$this->flags = [];
|
||||||
|
foreach($data['flags'] as $flag)
|
||||||
|
{
|
||||||
|
if($flag instanceof PeerFlags)
|
||||||
|
{
|
||||||
|
$this->flags[] = $flag->value;
|
||||||
|
}
|
||||||
|
elseif(is_string($flag))
|
||||||
|
{
|
||||||
|
$this->flags[] = $flag;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new InvalidArgumentException('Invalid flag type, got type ' . gettype($flag));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elseif(is_string($data['flags']))
|
||||||
|
{
|
||||||
|
$this->flags = PeerFlags::fromString($data['flags']);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new InvalidArgumentException('Invalid flags value type, got type ' . gettype($data['flags']));
|
||||||
|
}
|
||||||
|
|
||||||
$this->registered = $data['registered'];
|
$this->registered = $data['registered'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue