Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

Commit 54a9e34

Browse files
authored
Update JweHeader.php
1 parent 5117b85 commit 54a9e34

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Developer/Encryption/JWE/JweHeader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public function __construct($alg, $enc, $kid, $cty)
1313
{
1414
$this->alg = $alg;
1515
$this->enc = $enc;
16-
$this->kid = $kid;
16+
if(!is_null($kid)) $this->kid = $kid;
1717
if(!is_null($cty)) $this->cty = $cty;
1818
}
1919

@@ -36,7 +36,7 @@ public static function parseJweHeader($encodedHeader)
3636

3737
$alg = $headerObj["alg"];
3838
$enc = $headerObj["enc"];
39-
$kid = $headerObj["kid"];
39+
$kid = (isset($headerObj["kid"])) ? $headerObj["kid"] : null;
4040
$cty = (isset($headerObj["cty"])) ? $headerObj["cty"] : null;
4141
return new JweHeader($alg, $enc, $kid, $cty);
4242
}

0 commit comments

Comments
 (0)