Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ziming opened this issue Mar 19, 2025 · 2 comments

Comments

@ziming
Copy link

ziming commented Mar 19, 2025

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

Copy link

stale bot commented Apr 26, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 26, 2025
@ziming
Copy link
Author

ziming commented Apr 26, 2025

bump

@stale stale bot removed the wontfix label Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant