Skip to content
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

How to generate INI latter for a bank? #8

Open
andrew-svirin opened this issue Oct 20, 2016 · 1 comment
Open

How to generate INI latter for a bank? #8

andrew-svirin opened this issue Oct 20, 2016 · 1 comment

Comments

@andrew-svirin
Copy link

andrew-svirin commented Oct 20, 2016

On PHP for generate Hash (SHA-256).
I do next. But I do not know exactly is it correct. Please check me and correct if I am wrong.

Here is correct certificat (INI response is OK).
$cert = file_get_contents('files/cert.pem');
$cert_array = openssl_x509_parse($cert);
$cert_details = openssl_pkey_get_details(openssl_pkey_get_public($cert));

Exponent hash without leading zeros.
$exponent = ltrim(hash('sha256', base64_encode($cert_details['rsa']['e'])), '0');

Modulus hash without leading zeros.
$modulus = ltrim(hash('sha256', base64_encode($cert_details['rsa']['n'])), '0');

HEX representation.
$A006_unpack = unpack("H*", $exponent . ' ' . $modulus);
$A006_H = array_shift($A006_unpack);

Here is my Hash (SHA-256).
echo implode(' ', str_split(strtoupper($A006_H), 2));

@andrew-svirin andrew-svirin changed the title Hot to generetae INI latter for a bank? How to generetae INI latter for a bank? Oct 20, 2016
@andrew-svirin andrew-svirin changed the title How to generetae INI latter for a bank? How to generate INI latter for a bank? Oct 20, 2016
@charlycoste
Copy link
Member

charlycoste commented Oct 20, 2016

"Having conversations" is not the purpose of the issue tracker. Please, consider using https://gitter.im/Synap/EBICS.php for it (as there is many things to say) or sending me an e-mail at [email protected]
By the way, I will have a look at your code and tell you if I see something wrong.

Gitter

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

2 participants