starkbank / ecdsa-php

A lightweight and fast PHP ECDSA library
https://starkbank.com
MIT License
82 stars 13 forks source link

you must to declare the config option in array of config #11

Closed Ali7med closed 2 years ago

Ali7med commented 2 years ago

hi , i have error in use this algorithm when i try to solve this issue , i found you not declare the conflig with the class PrivateKey . $config = array( "config" => 'C:/xampp/php/extras/openssl/openssl.cnf', "digest_alg" => "sha256", "private_key_bits" => 2048, "private_key_type" => OPENSSL_KEYTYPE_EC, "curve_name" => $curve ); u can check the https://www.php.net/manual/en/function.openssl-pkey-new.php

thanks

leandro-stark commented 2 years ago

Hi, Ali!

This config element is a configuration for Windows users that want to use the key generation and certificate signing functions. When either function is called, PHP will search for the openssl.cnf in your system path. You must indicate its location or it will be assumed it is in the default certificate location, configured when the openssl DLL was compiled.

The current ECDSA is only a thin OpenSSL wrapper which requires this system configuration to use it. We intend to update this starkbank/ecdsa-php to a native version in order to prevent system configuration problems.

While the native version is not released, it’s possible to fork the repository and add this config parameter at your side.

If you have any additional questions, don’t hesitate to ask!

Best,

Ali7med commented 2 years ago

thanks , its solved