oauth2-server/tests/Stubs/CryptTraitStub.php

31 lines
528 B
PHP
Raw Permalink Normal View History

2016-03-18 01:48:28 +05:30
<?php
namespace LeagueTests\Stubs;
use League\OAuth2\Server\CryptTrait;
class CryptTraitStub
{
use CryptTrait;
public function __construct()
{
2017-07-01 22:41:19 +05:30
$this->setEncryptionKey(base64_encode(random_bytes(36)));
}
public function getKey()
{
return $this->encryptionKey;
2016-03-18 01:48:28 +05:30
}
public function doEncrypt($unencryptedData)
{
return $this->encrypt($unencryptedData);
}
public function doDecrypt($encryptedData)
{
return $this->decrypt($encryptedData);
}
}