Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

Apply fixes from StyleCI #185

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Apply fixes from StyleCI
[ci skip] [skip ci]
  • Loading branch information
Spomky authored and StyleCIBot committed Jul 31, 2017
commit 3a2d3b1d0db0924fdbde27edf9523df7a7de7409
9 changes: 9 additions & 0 deletions performance/ES256Bench.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Performance;

use Jose\Component\Core\JWK;
Expand Down
9 changes: 9 additions & 0 deletions performance/ES384Bench.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Performance;

use Jose\Component\Core\JWK;
Expand Down
9 changes: 9 additions & 0 deletions performance/ES512Bench.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Performance;

use Jose\Component\Core\JWK;
Expand Down
9 changes: 9 additions & 0 deletions performance/EdDSABench.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Performance;

use Jose\Component\Core\JWK;
Expand Down
9 changes: 9 additions & 0 deletions performance/HS256Bench.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Performance;

use Jose\Component\Core\JWK;
Expand Down
9 changes: 9 additions & 0 deletions performance/HS384Bench.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Performance;

use Jose\Component\Core\JWK;
Expand Down
9 changes: 9 additions & 0 deletions performance/HS512Bench.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Performance;

use Jose\Component\Core\JWK;
Expand Down
9 changes: 9 additions & 0 deletions performance/NoneBench.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Performance;

use Jose\Component\Core\JWK;
Expand Down
9 changes: 9 additions & 0 deletions performance/PS256Bench.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Performance;

use Jose\Component\Core\JWK;
Expand Down
9 changes: 9 additions & 0 deletions performance/PS384Bench.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Performance;

use Jose\Component\Core\JWK;
Expand Down
9 changes: 9 additions & 0 deletions performance/PS512Bench.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Performance;

use Jose\Component\Core\JWK;
Expand Down
9 changes: 9 additions & 0 deletions performance/RS256Bench.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Performance;

use Jose\Component\Core\JWK;
Expand Down
9 changes: 9 additions & 0 deletions performance/RS384Bench.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Performance;

use Jose\Component\Core\JWK;
Expand Down
9 changes: 9 additions & 0 deletions performance/RS512Bench.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?php

/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Performance;

use Jose\Component\Core\JWK;
Expand Down
13 changes: 9 additions & 4 deletions performance/SignatureBench.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
<?php

namespace Jose\Performance;
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/

namespace Jose\Performance;

use Jose\Component\Core\JWAManager;
use Jose\Component\Core\JWK;
Expand Down Expand Up @@ -40,9 +48,6 @@ abstract class SignatureBench
*/
private $jwaManager;

/**
*
*/
public function init()
{
$this->jwaManager = JWAManager::create([
Expand Down
3 changes: 1 addition & 2 deletions src/Component/Signature/Algorithm/RSA.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public function verify(JWK $key, string $input, string $signature): bool
{
$this->checkKey($key);


if ($this->getSignatureMethod() === self::SIGNATURE_PSS) {
$pub = RSAKey::createFromJWK($key->toPublic());

return JoseRSA::verify($pub, $input, $signature, $this->getAlgorithm());
} else {
return 1 === openssl_verify($input, $signature, $key->toPublic()->toPEM(), $this->getAlgorithm());
Expand All @@ -68,7 +68,6 @@ public function sign(JWK $key, string $input): string
$this->checkKey($key);
Assertion::true($key->has('d'), 'The key is not a private key');


if ($this->getSignatureMethod() === self::SIGNATURE_PSS) {
$priv = RSAKey::createFromJWK($key);
$signature = JoseRSA::sign($priv, $input, $this->getAlgorithm());
Expand Down