Made message signing in Cryptography use SHA512 as the message content for... #1
2 changed files with 0 additions and 38 deletions
|
@ -564,18 +564,8 @@
|
|||
return null;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$peer = Socialbox::resolvePeer($contactAddress);
|
||||
}
|
||||
catch (StandardRpcException $e)
|
||||
{
|
||||
$peer = null;
|
||||
}
|
||||
|
||||
return new ContactRecord([
|
||||
'address' => $contact->getContactPeerAddress(),
|
||||
'peer' => $peer,
|
||||
'relationship' => $contact->getRelationship(),
|
||||
'known_keys' => self::contactGetSigningKeys($contact),
|
||||
'added_timestamp' => $contact->getCreated()->getTimestamp()
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
class ContactRecord implements SerializableInterface
|
||||
{
|
||||
private PeerAddress $address;
|
||||
private ?Peer $peer;
|
||||
private ContactRelationshipType $relationship;
|
||||
/**
|
||||
* @var KnownSigningKey[]
|
||||
|
@ -26,22 +25,6 @@
|
|||
public function __construct(array $data)
|
||||
{
|
||||
$this->address = PeerAddress::fromAddress($data['address']);
|
||||
if(is_array($data['peer']))
|
||||
{
|
||||
$this->peer = Peer::fromArray($data['peer']);
|
||||
}
|
||||
elseif($data['peer'] instanceof Peer)
|
||||
{
|
||||
$this->peer = $data['peer'];
|
||||
}
|
||||
elseif(is_null($data['peer']))
|
||||
{
|
||||
$this->peer = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidArgumentException('Invalid peer data');
|
||||
}
|
||||
|
||||
if($data['relationship'] instanceof ContactRelationshipType)
|
||||
{
|
||||
|
@ -86,16 +69,6 @@
|
|||
return $this->address;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the peer of the contact.
|
||||
*
|
||||
* @return Peer|null Returns the peer of the contact. If the peer is not known, null is returned.
|
||||
*/
|
||||
public function getPeer(): ?Peer
|
||||
{
|
||||
return $this->peer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the relationship of the contact.
|
||||
*
|
||||
|
@ -141,7 +114,6 @@
|
|||
{
|
||||
return [
|
||||
'address' => $this->address->getAddress(),
|
||||
'peer' => $this->peer?->toArray(),
|
||||
'relationship' => $this->relationship->value,
|
||||
'known_keys' => array_map(function($key) {return $key->toArray();}, $this->knownKeys),
|
||||
'added_timestamp' => $this->addedTimestamp
|
||||
|
|
Loading…
Add table
Reference in a new issue