CryptTrait tests

This commit is contained in:
Julián Gutiérrez
2016-03-17 21:18:28 +01:00
parent c2e83ff359
commit 890fdeba16
13 changed files with 236 additions and 170 deletions

View File

@@ -16,11 +16,11 @@ class AccessTokenEntity implements AccessTokenEntityInterface
/**
* Generate a JWT from the access token
*
* @param string $pathToPrivateKey
* @param string $privateKeyPath
*
* @return string
*/
public function convertToJWT($pathToPrivateKey)
public function convertToJWT($privateKeyPath)
{
return (new Builder())
->setAudience($this->getClient()->getIdentifier())
@@ -30,7 +30,7 @@ class AccessTokenEntity implements AccessTokenEntityInterface
->setExpiration($this->getExpiryDateTime()->getTimestamp())
->setSubject($this->getUserIdentifier())
->set('scopes', $this->getScopes())
->sign(new Sha256(), new Key($pathToPrivateKey))
->sign(new Sha256(), new Key($privateKeyPath))
->getToken();
}
}

View File

@@ -7,9 +7,9 @@ interface AccessTokenEntityInterface extends TokenInterface
/**
* Generate a JWT from the access token
*
* @param string $pathToPrivateKey
* @param string $privateKeyPath
*
* @return string
*/
public function convertToJWT($pathToPrivateKey);
public function convertToJWT($privateKeyPath);
}

View File

@@ -89,14 +89,14 @@ interface GrantTypeInterface extends EmitterAwareInterface
/**
* Set the path to the private key.
*
* @param string $pathToPrivateKey
* @param string $privateKeyPath
*/
public function setPrivateKeyPath($pathToPrivateKey);
public function setPrivateKeyPath($privateKeyPath);
/**
* Set the path to the public key.
*
* @param string $pathToPublicKey
* @param string $publicKeyPath
*/
public function setPublicKeyPath($pathToPublicKey);
public function setPublicKeyPath($publicKeyPath);
}