AcmePhp\Cli\Repository\Repository::loadAccountKeyPair PHP Method

loadAccountKeyPair() public method

public loadAccountKeyPair ( )
    public function loadAccountKeyPair()
    {
        try {
            $publicKeyPem = $this->master->read('private/_account/public.pem');
            $privateKeyPem = $this->master->read('private/_account/private.pem');
            return new KeyPair($this->serializer->deserialize($publicKeyPem, PublicKey::class, PemEncoder::FORMAT), $this->serializer->deserialize($privateKeyPem, PrivateKey::class, PemEncoder::FORMAT));
        } catch (\Exception $e) {
            throw new AcmeCliException('Loading of account key pair failed', $e);
        }
    }

Usage Example

 /**
  * @expectedException \AcmePhp\Cli\Exception\AcmeCliException
  */
 public function testLoadAccountKeyPairFail()
 {
     $this->repository->loadAccountKeyPair();
 }