Skip to content

JWKFactory::createECKey() error openssl_pkey_new(): Private key length must be at least 384 bits, configured to 0 #611

Description

@ziming

Version(s) affected

4.0.4

Description

Given the following code example (see how to reproduce). I keep get this error

WARNING openssl_pkey_new(): Private key length must be at least 384 bits, configured to 0 in vendor/web-token/jwt-framework/src/Library/Core/Util/ECKey.php on line 92.

How to reproduce

use Jose\Component\KeyManagement\JWKFactory;

$jwk = JWKFactory::createECKey(
    'P-256',
    [
        'alg' => 'ES256',
        'use' => 'sig',
        'kid' => 'sig-1234',
    ]
);

Possible Solution

This may be relevant

https://stackoverflow.com/questions/62430373/why-cant-i-use-key-lengths-384bit-for-ec-in-php-openssl

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions