Skip to content

Commit

Permalink
Data collector messages (#152)
Browse files Browse the repository at this point in the history
* New colors + new template organization
* DataCollector updated
* JWE/JWS event collections
* Header/Claim check events
  • Loading branch information
Spomky authored Jan 4, 2019
1 parent 1c3a5b5 commit 841ccaf
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions ECDHES.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,6 @@ private function getKeysFromPrivateKeyAndHeader(JWK $recipient_key, array $compl
return [$public_key, $private_key];
}

/**
* @throws \InvalidArgumentException
*/
public function calculateAgreementKey(JWK $private_key, JWK $public_key): string
{
switch ($public_key->get('crv')) {
Expand Down Expand Up @@ -125,10 +122,7 @@ public function getKeyManagementMode(): string
return self::MODE_AGREEMENT;
}

/**
* @return JWK
*/
private function getPublicKey(array $complete_header)
private function getPublicKey(array $complete_header): JWK
{
if (!\array_key_exists('epk', $complete_header)) {
throw new \InvalidArgumentException('The header parameter "epk" is missing');
Expand All @@ -143,10 +137,7 @@ private function getPublicKey(array $complete_header)
return $public_key;
}

/**
* @param bool $is_private
*/
private function checkKey(JWK $key, $is_private)
private function checkKey(JWK $key, bool $is_private): void
{
if (!\in_array($key->get('kty'), $this->allowedKeyTypes(), true)) {
throw new \InvalidArgumentException('Wrong key type.');
Expand Down Expand Up @@ -178,9 +169,6 @@ private function checkKey(JWK $key, $is_private)
}
}

/**
* @throws \InvalidArgumentException
*/
private function getCurve(string $crv): Curve
{
switch ($crv) {
Expand Down

0 comments on commit 841ccaf

Please sign in to comment.