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

Commit 69c05d7

Browse files
committed
Fixing other broken test
1 parent b7803b1 commit 69c05d7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Developer/Encryption/JweConfigBuilder.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ private function checkParameterValues() {
100100
private function computeEncryptionKeyFingerprint($encryptionCertificate) {
101101
if(isset($encryptionCertificate)) {
102102
try {
103-
$publicKeyPem = openssl_pkey_get_details(openssl_pkey_get_public($encryptionCertificate->getBytes()))['key'];
103+
$publicKey = openssl_pkey_get_public($encryptionCertificate->getBytes());
104+
if($publicKey == false){
105+
throw new EncryptionException('Invalid encryption cert');
106+
}
107+
$publicKeyPem = openssl_pkey_get_details($publicKey)['key'];
104108
$publicKeyDer = EncodingUtils::pemToDer($publicKeyPem, '-----BEGIN PUBLIC KEY-----', '-----END PUBLIC KEY-----');
105109
$hash = new Hash('sha256');
106110
$this->encryptionKeyFingerprint = EncodingUtils::encodeBytes($hash->hash($publicKeyDer), FieldValueEncoding::HEX);

0 commit comments

Comments
 (0)