Skip to content

Commit 5f69066

Browse files
authored
Merge pull request #3 from portier/fixOldOpenssl
Fix older OpenSSL versions requiring PEM wrapping
2 parents cd82174 + 4a0dc16 commit 5f69066

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Client.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,11 @@ private static function parseJwk($jwk)
137137
$seq->addChild(new \FG\ASN1\Universal\Integer(gmp_strval($e)));
138138
$pkey = new \FG\X509\PublicKey(bin2hex($seq->getBinary()));
139139

140+
$encoded = base64_encode($pkey->getBinary());
141+
140142
return new \Lcobucci\JWT\Signer\Key(
141143
"-----BEGIN PUBLIC KEY-----\n" .
142-
base64_encode($pkey->getBinary()) . "\n" .
144+
chunk_split($encoded, 64, "\n") .
143145
"-----END PUBLIC KEY-----\n"
144146
);
145147
}

0 commit comments

Comments
 (0)