Skip to content

Commit 7b02717

Browse files
authored
fix: EC key generation for OpenSSL 3.6+ (#448)
1 parent 8cd2565 commit 7b02717

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/Encryption.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,10 @@ private static function createInfo(string $type, ?string $context, ContentEncodi
251251
private static function createLocalKeyObject(): array
252252
{
253253
$keyResource = openssl_pkey_new([
254-
'curve_name' => 'prime256v1',
255-
'private_key_type' => OPENSSL_KEYTYPE_EC,
254+
'ec' => [
255+
'curve_name' => 'prime256v1',
256+
'private_key_type' => OPENSSL_KEYTYPE_EC,
257+
],
256258
]);
257259
if (!$keyResource) {
258260
throw new \RuntimeException('Unable to create the local key.');

0 commit comments

Comments
 (0)