Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c095c56

Browse filesBrowse files
committed
Updated following the review
1 parent 7c08e18 commit c095c56
Copy full SHA for c095c56

File tree

5 files changed

+23
-17
lines changed
Filter options

5 files changed

+23
-17
lines changed

‎src/Symfony/Component/Security/Core/Encryption/AsymmetricEncryptionInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Encryption/AsymmetricEncryptionInterface.php
+10-7Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,25 @@
2424
* When Bob receive the message, he will decrypt it with keypair [ bob_private, alice_public ].
2525
*
2626
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
27-
* @experimental in 5.2
27+
*
28+
* @experimental in 5.3
2829
*/
2930
interface AsymmetricEncryptionInterface
3031
{
3132
/**
32-
* Generate new a keypair to be used with encryption. Don't loose your private
33-
* key and make sure to keep it a secret.
33+
* Generates new a keypair to be used with encryption.
34+
*
35+
* Don't lose your private key and make sure to keep it a secret.
3436
*
3537
* @return array{public: string, private: string}
3638
*/
3739
public function generateKeypair(): array;
3840

3941
/**
40-
* When Alice wants to send a secret message to Bob.
42+
* Get an encrypted version of the message.
4143
*
42-
* This function encrypt the message so only Bob can see it.
44+
* When Alice wants to send a secret message to Bob. This function encrypt the
45+
* message so only Bob can see it.
4346
*
4447
* @param string $message plain text version of the message
4548
* @param string $publicKey Bob's public key
@@ -50,9 +53,9 @@ public function generateKeypair(): array;
5053
public function encrypt(string $message, string $publicKey, ?string $privateKey = null): string;
5154

5255
/**
53-
* When Bob gets a secret message from Alice.
56+
* Get a plain text version of the encrypted message.
5457
*
55-
* This function decrypt the message.
58+
* When Bob gets a secret message from Alice. This function decrypt the message.
5659
*
5760
* @param string $message encrypted version of the message
5861
* @param string $privateKey Bob's private key

‎src/Symfony/Component/Security/Core/Encryption/PhpseclibEncryption.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Encryption/PhpseclibEncryption.php
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,16 @@
2727
* The secret key length should be 32 bytes, but other sizes are accepted.
2828
*
2929
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
30-
* @experimental in 5.2
30+
*
31+
* @experimental in 5.3
3132
*/
3233
class PhpseclibEncryption implements SymmetricEncryptionInterface, AsymmetricEncryptionInterface
3334
{
35+
private $secret;
36+
3437
/**
3538
* @var string application secret
3639
*/
37-
private $secret;
38-
3940
public function __construct(string $secret)
4041
{
4142
$this->secret = $secret;

‎src/Symfony/Component/Security/Core/Encryption/SodiumEncryption.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Encryption/SodiumEncryption.php
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,16 @@
2121
* The secret key length should be 32 bytes, but other sizes are accepted.
2222
*
2323
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
24-
* @experimental in 5.2
24+
*
25+
* @experimental in 5.3
2526
*/
2627
class SodiumEncryption implements SymmetricEncryptionInterface, AsymmetricEncryptionInterface
2728
{
29+
private $secret;
30+
2831
/**
2932
* @var string application secret
3033
*/
31-
private $secret;
32-
3334
public function __construct(string $secret)
3435
{
3536
$this->secret = $secret;

‎src/Symfony/Component/Security/Core/Encryption/SymmetricEncryptionInterface.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Encryption/SymmetricEncryptionInterface.php
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/**
1818
* Symmetric encryption uses the same key to encrypt and decrypt a message. The
19-
* keys should be kept safe and should not be exposed to the public. Symmetric
19+
* key should be kept safe and should not be exposed to the public. Symmetric
2020
* encryption should be used when you are not sending the encrypted message to
2121
* anyone else.
2222
*
@@ -25,7 +25,8 @@
2525
* Symmetric encryption is in theory weaker than asymmetric encryption.
2626
*
2727
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
28-
* @experimental in 5.2
28+
*
29+
* @experimental in 5.3
2930
*/
3031
interface SymmetricEncryptionInterface
3132
{
@@ -39,7 +40,7 @@ interface SymmetricEncryptionInterface
3940
public function encrypt(string $message): string;
4041

4142
/**
42-
* Get a plain text version of the message.
43+
* Get a plain text version of the encrypted message.
4344
*
4445
* @param string $message encrypted version of the message
4546
*

‎src/Symfony/Component/Security/Core/Exception/EncryptionException.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Exception/EncryptionException.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414
/**
1515
* @author Tobias Nyholm <tobias.nyholm@gmail.com>
1616
*/
17-
class EncryptionException extends \Exception implements EncryptionExceptionInterface
17+
class EncryptionException extends \RuntimeException implements EncryptionExceptionInterface
1818
{
1919
}

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.