Skip to content

Commit 5d7120e

Browse files
authored
Bug fixed (#132)
EC keys were not correctly created using the OpenSSL method.
1 parent 8066ef6 commit 5d7120e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Component/Core/Util/ECKey.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private static function p256PrivateKey(JWK $jwk): string
165165
.$d
166166
.'a00a' // TAGGED OBJECT #0, length 10
167167
.'0608' // OID, length 8
168-
.'2a8648ce3d030107' // 1.3.132.0.34 = P-384 Curve
168+
.'2a8648ce3d030107' // 1.3.132.0.34 = P-256 Curve
169169
.'a144' // TAGGED OBJECT #1, length 68
170170
.'0342' // BIT STRING, length 66
171171
.'00' // prepend with NUL - pubkey will follow

src/Component/KeyManagement/JWKFactory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ private static function createECKeyUsingOpenSSL(string $curve): array
132132
return [
133133
'kty' => 'EC',
134134
'crv' => $curve,
135-
'x' => Base64Url::encode(bin2hex($details['ec']['x'])),
136-
'y' => Base64Url::encode(bin2hex($details['ec']['y'])),
137-
'd' => Base64Url::encode(bin2hex($details['ec']['d'])),
135+
'x' => Base64Url::encode($details['ec']['x']),
136+
'y' => Base64Url::encode($details['ec']['y']),
137+
'd' => Base64Url::encode($details['ec']['d']),
138138
];
139139
}
140140

0 commit comments

Comments
 (0)