@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | "JWK Set must have a 'keys' member."); |
| 66 | 66 | } |
| 67 | 67 | $jwks = array_map( |
| 68 | - function ($jwkdata) { |
|
| 68 | + function($jwkdata) { |
|
| 69 | 69 | return JWK::fromArray($jwkdata); |
| 70 | 70 | }, $members["keys"]); |
| 71 | 71 | unset($members["keys"]); |
@@ -198,7 +198,7 @@ discard block |
||
| 198 | 198 | { |
| 199 | 199 | $data = $this->_additional; |
| 200 | 200 | $data["keys"] = array_map( |
| 201 | - function (JWK $jwk) { |
|
| 201 | + function(JWK $jwk) { |
|
| 202 | 202 | return $jwk->toArray(); |
| 203 | 203 | }, $this->_jwks); |
| 204 | 204 | return $data; |
@@ -70,9 +70,9 @@ |
||
| 70 | 70 | // time_mid |
| 71 | 71 | mt_rand(0, 0xffff), |
| 72 | 72 | // time_hi_and_version |
| 73 | - mt_rand(0, 0x0fff) | 0x4000, |
|
| 73 | + mt_rand(0, 0x0fff)|0x4000, |
|
| 74 | 74 | // clk_seq_hi_res |
| 75 | - mt_rand(0, 0x3f) | 0x80, |
|
| 75 | + mt_rand(0, 0x3f)|0x80, |
|
| 76 | 76 | // clk_seq_low |
| 77 | 77 | mt_rand(0, 0xff), |
| 78 | 78 | // node |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * be updated to contain parameters specific to the encryption |
| 38 | 38 | * @return string Ciphertext |
| 39 | 39 | */ |
| 40 | - abstract protected function _encryptKey(string $key, Header &$header): string; |
|
| 40 | + abstract protected function _encryptKey(string $key, Header&$header): string; |
|
| 41 | 41 | |
| 42 | 42 | /** |
| 43 | 43 | * Decrypt a key. |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * @throws \RuntimeException For generic errors |
| 61 | 61 | * @return string Encrypted key |
| 62 | 62 | */ |
| 63 | - final public function encrypt(string $cek, Header &$header = null): string |
|
| 63 | + final public function encrypt(string $cek, Header&$header = null): string |
|
| 64 | 64 | { |
| 65 | 65 | if (!isset($header)) { |
| 66 | 66 | $header = new Header(); |
@@ -153,7 +153,7 @@ |
||
| 153 | 153 | * |
| 154 | 154 | * {@inheritdoc} |
| 155 | 155 | */ |
| 156 | - protected function _encryptKey(string $key, Header &$header): string |
|
| 156 | + protected function _encryptKey(string $key, Header&$header): string |
|
| 157 | 157 | { |
| 158 | 158 | $pubkey = openssl_pkey_get_public( |
| 159 | 159 | $this->publicKey() |
@@ -151,7 +151,7 @@ |
||
| 151 | 151 | * @see \JWX\JWE\KeyManagementAlgorithm::_encryptKey() |
| 152 | 152 | * @return string |
| 153 | 153 | */ |
| 154 | - protected function _encryptKey(string $key, Header &$header): string |
|
| 154 | + protected function _encryptKey(string $key, Header&$header): string |
|
| 155 | 155 | { |
| 156 | 156 | list($ciphertext, $auth_tag) = $this->_getGCM()->encrypt($key, "", |
| 157 | 157 | $this->_kek, $this->_iv); |
@@ -66,7 +66,7 @@ |
||
| 66 | 66 | * |
| 67 | 67 | * {@inheritdoc} |
| 68 | 68 | */ |
| 69 | - protected function _encryptKey(string $key, Header &$header): string |
|
| 69 | + protected function _encryptKey(string $key, Header&$header): string |
|
| 70 | 70 | { |
| 71 | 71 | if ($key != $this->_cek) { |
| 72 | 72 | throw new \LogicException("Content encryption key doesn't match."); |
@@ -193,7 +193,7 @@ |
||
| 193 | 193 | * |
| 194 | 194 | * {@inheritdoc} |
| 195 | 195 | */ |
| 196 | - protected function _encryptKey(string $key, Header &$header): string |
|
| 196 | + protected function _encryptKey(string $key, Header&$header): string |
|
| 197 | 197 | { |
| 198 | 198 | return $this->_kwAlgo()->wrap($key, $this->_derivedKey()); |
| 199 | 199 | } |
@@ -116,7 +116,7 @@ |
||
| 116 | 116 | * |
| 117 | 117 | * {@inheritdoc} |
| 118 | 118 | */ |
| 119 | - protected function _encryptKey(string $key, Header &$header): string |
|
| 119 | + protected function _encryptKey(string $key, Header&$header): string |
|
| 120 | 120 | { |
| 121 | 121 | return $this->_kw()->wrap($key, $this->_kek); |
| 122 | 122 | } |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | public static function fromBase256(string $octets): self |
| 51 | 51 | { |
| 52 | - $num = gmp_import($octets, 1, GMP_MSW_FIRST | GMP_BIG_ENDIAN); |
|
| 52 | + $num = gmp_import($octets, 1, GMP_MSW_FIRST|GMP_BIG_ENDIAN); |
|
| 53 | 53 | return new self($num); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function base256(): string |
| 82 | 82 | { |
| 83 | - return gmp_export($this->_num, 1, GMP_MSW_FIRST | GMP_BIG_ENDIAN); |
|
| 83 | + return gmp_export($this->_num, 1, GMP_MSW_FIRST|GMP_BIG_ENDIAN); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |