Skip to content

Commit 4453178

Browse files
committed
Add public key to Keys configuration class.
1 parent 08b8b4a commit 4453178

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/Config/Keys.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace Pdsinterop\Solid\Auth\Config;
44

55
use Defuse\Crypto\Key as CryptoKey;
6+
use Lcobucci\JWT\Signer\Key;
67
use League\OAuth2\Server\CryptKey;
78

89
class Keys
@@ -13,6 +14,8 @@ class Keys
1314
private $encryptionKey;
1415
/** @var CryptKey*/
1516
private $privateKey;
17+
/** @var Key */
18+
private $publicKey;
1619

1720
//////////////////////////// GETTERS AND SETTERS \\\\\\\\\\\\\\\\\\\\\\\\\\\
1821

@@ -28,6 +31,12 @@ final public function getPrivateKey() : CryptKey
2831
return $this->privateKey;
2932
}
3033

34+
/*** @return Key */
35+
public function getPublicKey() : Key
36+
{
37+
return $this->publicKey;
38+
}
39+
3140
//////////////////////////////// PUBLIC API \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
3241

3342
/**
@@ -36,10 +45,11 @@ final public function getPrivateKey() : CryptKey
3645
* @param CryptKey $privateKey
3746
* @param string|CryptoKey $encryptionKey
3847
*/
39-
final public function __construct(CryptKey $privateKey, $encryptionKey)
48+
final public function __construct(CryptKey $privateKey, Key $publicKey, $encryptionKey)
4049
{
4150
// @FIXME: Add type-check for $encryptionKey (or an extending class with different parameter type?)
4251
$this->encryptionKey = $encryptionKey;
4352
$this->privateKey = $privateKey;
53+
$this->publicKey = $publicKey;
4454
}
4555
}

0 commit comments

Comments
 (0)