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

Applied fixes from StyleCI #80

Merged
merged 1 commit into from
Jan 29, 2016
Merged
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
1 change: 1 addition & 0 deletions src/Algorithm/ContentEncryption/AESOpenSSL.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/

namespace Jose\Algorithm\ContentEncryption;

use Jose\Util\StringUtil;

/**
Expand Down
34 changes: 15 additions & 19 deletions src/Encrypter.php
Original file line number Diff line number Diff line change
Expand Up @@ -241,22 +241,22 @@ private function areKeyManagementModesCompatible($current, $new)
$wrap = KeyEncryptionAlgorithmInterface::MODE_WRAP;

$supported_key_management_mode_combinations = [
$agree.$enc => true,
$agree.$wrap => true,
$dir.$enc => true,
$dir.$wrap => true,
$enc.$enc => true,
$enc.$wrap => true,
$wrap.$enc => true,
$wrap.$wrap => true,
$agree.$enc => true,
$agree.$wrap => true,
$dir.$enc => true,
$dir.$wrap => true,
$enc.$enc => true,
$enc.$wrap => true,
$wrap.$enc => true,
$wrap.$wrap => true,
$agree.$agree => false,
$agree.$dir => false,
$dir.$agree => false,
$dir.$dir => false,
$enc.$agree => false,
$enc.$dir => false,
$wrap.$agree => false,
$wrap.$dir => false,
$agree.$dir => false,
$dir.$agree => false,
$dir.$dir => false,
$enc.$agree => false,
$enc.$dir => false,
$wrap.$agree => false,
$wrap.$dir => false,
];

if (array_key_exists($current.$new, $supported_key_management_mode_combinations)) {
Expand Down Expand Up @@ -309,16 +309,12 @@ private function preparePayload($payload, array $complete_headers)
private function getEncryptedKey(array $complete_headers, $cek, KeyEncryptionAlgorithmInterface $key_encryption_algorithm, ContentEncryptionAlgorithmInterface $content_encryption_algorithm, array &$additional_headers, JWKInterface $recipient_key, JWKInterface $sender_key = null)
{
if ($key_encryption_algorithm instanceof KeyEncryptionInterface) {

return $this->getEncryptedKeyFroKeyEncryptionAlgorithm($complete_headers, $cek, $key_encryption_algorithm, $recipient_key);
} elseif ($key_encryption_algorithm instanceof KeyWrappingInterface) {

return $this->getEncryptedKeyFroKeyWrappingAlgorithm($complete_headers, $cek, $key_encryption_algorithm, $recipient_key);
} elseif ($key_encryption_algorithm instanceof KeyAgreementWrappingInterface) {

return $this->getEncryptedKeyFroKeyAgreementAndKeyWrappingAlgorithm($complete_headers, $cek, $key_encryption_algorithm, $content_encryption_algorithm, $additional_headers, $recipient_key, $sender_key);
} elseif ($key_encryption_algorithm instanceof KeyAgreementInterface) {

return $this->getEncryptedKeyFroKeyAgreementAlgorithm($complete_headers, $key_encryption_algorithm, $content_encryption_algorithm, $additional_headers, $recipient_key, $sender_key);
}
}
Expand Down
1 change: 0 additions & 1 deletion src/Object/JWE.php
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ public function toFlattenedJSON($id)
*/
public function toJSON()
{

$json = $this->getJSONBase();
$json['recipients'] = [];

Expand Down