Skip to content

Commit

Permalink
quick fix for previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ziming committed Jul 3, 2022
1 parent 0243d42 commit 8a619f4
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/Services/MyinfoSecurityService.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,18 @@ public static function decryptJWE(string $personDataToken, string $privateKeyPat
// $passphrase is by default null for backward compatibility purpose as I want to avoid a major version bump
$passphrase = ($passphrase === null) ? config('laravel-myinfo-sg.client_secret') : $passphrase;

$jwk = JWKFactory::createFromKeyFile(
$privateKeyPath,
$passphrase
);
if (config('laravel-myinfo-sg.private_key_content')) {
$jwk = JWKFactory::createFromKey(
config('laravel-myinfo-sg.private_key_content'),
$passphrase
);
} else {
$jwk = JWKFactory::createFromKeyFile(
$privateKeyPath,
$passphrase
);
}


$serializerManager = new JWESerializerManager([
new \Jose\Component\Encryption\Serializer\CompactSerializer,
Expand Down

0 comments on commit 8a619f4

Please sign in to comment.