<?php
declare(strict_types=1);
namespace App\Entity\System;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\System\EncryptionKeyRepository")
*/
class EncryptionKey
{
/**
* @ORM\Column(type="integer")
*
* @ORM\Id
*
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected ?int $id;
/**
* @ORM\Column(type="datetime")
*/
protected \DateTime $dateAdd;
/**
* @ORM\Column(type="text")
*/
protected string $publicKey;
/**
* @ORM\Column(type="text")
*/
protected string $privateKey;
/**
* Constructor
*/
public function __construct()
{
$this->dateAdd = new \DateTime();
}
public function getId(): ?int
{
return $this->id;
}
public function getDateAdd(): \DateTime
{
return $this->dateAdd;
}
public function getPublicKey(): string
{
return \base64_decode($this->publicKey);
}
public function setPublicKey(string $publicKey): EncryptionKey
{
$this->publicKey = \base64_encode($publicKey);
return $this;
}
public function getPrivateKey(): string
{
return \base64_decode($this->privateKey);
}
public function setPrivateKey(string $privateKey): EncryptionKey
{
$this->privateKey = \base64_encode($privateKey);
return $this;
}
}