Difference between revisions of "The signature generation"
| (19 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
| + | <span data-link_translate_en_title="The signature generation" data-link_translate_en_url="The signature generation"></span>[[:en:The signature generation]][[en:The signature generation]] | ||
| + | <span data-link_translate_he_title="הדור חתימה" data-link_translate_he_url="%D7%94%D7%93%D7%95%D7%A8+%D7%97%D7%AA%D7%99%D7%9E%D7%94"></span>[[:he:הדור חתימה]][[he:הדור חתימה]] | ||
| + | <span data-link_translate_ru_title="Создание подписи" data-link_translate_ru_url="%D0%A1%D0%BE%D0%B7%D0%B4%D0%B0%D0%BD%D0%B8%D0%B5+%D0%BF%D0%BE%D0%B4%D0%BF%D0%B8%D1%81%D0%B8"></span>[[:ru:Создание подписи]][[ru:Создание подписи]] | ||
| + | <span data-link_translate_ja_title="署名の生成" data-link_translate_ja_url="%E7%BD%B2%E5%90%8D%E3%81%AE%E7%94%9F%E6%88%90"></span>[[:ja:署名の生成]][[ja:署名の生成]] | ||
| + | <span data-link_translate_ar_title="توليد التوقيع" data-link_translate_ar_url="%D8%AA%D9%88%D9%84%D9%8A%D8%AF+%D8%A7%D9%84%D8%AA%D9%88%D9%82%D9%8A%D8%B9"></span>[[:ar:توليد التوقيع]][[ar:توليد التوقيع]] | ||
| + | <span data-link_translate_zh_title="签名生成" data-link_translate_zh_url="%E7%AD%BE%E5%90%8D%E7%94%9F%E6%88%90"></span>[[:zh:签名生成]][[zh:签名生成]] | ||
| + | <span data-link_translate_ro_title="Generația semnături" data-link_translate_ro_url="Genera%C8%9Bia+semn%C4%83turi"></span>[[:ro:Generația semnături]][[ro:Generația semnături]] | ||
| + | <span data-link_translate_pl_title="Generowanie podpisu" data-link_translate_pl_url="Generowanie+podpisu"></span>[[:pl:Generowanie podpisu]][[pl:Generowanie podpisu]] | ||
| + | <span data-link_translate_de_title="Die Signatur-generation" data-link_translate_de_url="Die+Signatur-generation"></span>[[:de:Die Signatur-generation]][[de:Die Signatur-generation]] | ||
| + | <span data-link_translate_nl_title="De handtekening generatie" data-link_translate_nl_url="De+handtekening+generatie"></span>[[:nl:De handtekening generatie]][[nl:De handtekening generatie]] | ||
| + | <span data-link_translate_it_title="La generazione della firma" data-link_translate_it_url="La+generazione+della+firma"></span>[[:it:La generazione della firma]][[it:La generazione della firma]] | ||
| + | <span data-link_translate_pt_title="A geração de assinatura" data-link_translate_pt_url="A+gera%C3%A7%C3%A3o+de+assinatura"></span>[[:pt:A geração de assinatura]][[pt:A geração de assinatura]] | ||
| + | <span data-link_translate_es_title="La generación de una firma" data-link_translate_es_url="La+generaci%C3%B3n+de+una+firma"></span>[[:es:La generación de una firma]][[es:La generación de una firma]] | ||
| + | <span data-link_translate_fr_title="Génération de la signature" data-link_translate_fr_url="G%C3%A9n%C3%A9ration_de_la_signature"></span>[[:fr:Génération de la signature]][[fr:Génération de la signature]] | ||
<br /> | <br /> | ||
| − | + | {{#seo: | |
| + | |title=The signature generation | ||
| + | |title_mode=append | ||
| + | |keywords=these,are,your,keywords | ||
| + | |description=The signature generation | ||
| + | |image=Uploaded_file.png | ||
| + | |image_alt=Wiki Logo | ||
| + | }} | ||
| − | <!-- | + | ==Introduction == <!--T:1--> |
| + | During a call to the API, as described in the WIKI of authentication, a signature is required. It is generated '''based on all of the parameters provided during the call '''.<br /> | ||
| + | For technical reasons and for the moment, the authentication parameters must 'always be transmitted via the HTTP GET method | ||
| − | + | ==Example == <!--T:2--> | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | ==== <!--T:2--> | ||
<!--T:3--> | <!--T:3--> | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> | ||
// Définition des paramètres | // Définition des paramètres | ||
| − | $data["login"] = "mail@example. | + | $data["login"] = "mail@example.com "; |
| − | $data["password"] = "4= | + | $data["password"] = "DH 4=674j_G "; // Mot de passe non chiffré |
// D"autres paramètres peuvent êtres ajoutés en fonction de l"appel à l"API | // D"autres paramètres peuvent êtres ajoutés en fonction de l"appel à l"API | ||
// $data["autre_parametre"] = "valeur"; | // $data["autre_parametre"] = "valeur"; | ||
| Line 42: | Line 59: | ||
// Encodage en base64, puis encodage en URL selon RFC 3986 | // Encodage en base64, puis encodage en URL selon RFC 3986 | ||
| − | $= rawurlencode(base64_encode($hash)); | + | $signature = rawurlencode(base64_encode($hash)); |
| − | // ==> $contient alors la finale | + | // ==> $signature contient alors la signature finale |
</syntaxhighlight> | </syntaxhighlight> | ||
| − | ==== <!--T:4--> | + | ==Conclusion == <!--T:4--> |
| − | () <br /> | + | Once the signature is generated, it is necessary to pass it as a parameter (In addition to all the other parameters ) to the API call.<br /> |
| − | :<br /> | + | Following the previous example, parameters to pass would have therefore been :<br /> |
| − | * = "mail@example. | + | * login = "mail@example.cOM " |
| − | * = "4= | + | * password = "DH 4=674j_G " |
| − | * = $ | + | * signature = $signature |
<!--T:5--> | <!--T:5--> | ||
<!-- Fin de l'article --> | <!-- Fin de l'article --> | ||
<br /><br /> | <br /><br /> | ||
| − | ? <vote /> | + | This article seemed you to be useful ? <vote /> |
<!-- Placez ici la catégorie à laquelle se rapporte votre article. Ex: [[Category:Help]] --> | <!-- Placez ici la catégorie à laquelle se rapporte votre article. Ex: [[Category:Help]] --> | ||
[[Category:API]] | [[Category:API]] | ||
| Line 63: | Line 80: | ||
<!--T:6--> | <!--T:6--> | ||
<!-- Gestion SEO. Indiquez les informations manquantes --> | <!-- Gestion SEO. Indiquez les informations manquantes --> | ||
| − | |||
| − | |||
<comments /> | <comments /> | ||
Latest revision as of 04:28, 6 November 2022
en:The signature generation
he:הדור חתימה
ru:Создание подписи
ja:署名の生成
ar:توليد التوقيع
zh:签名生成
ro:Generația semnături
pl:Generowanie podpisu
de:Die Signatur-generation
nl:De handtekening generatie
it:La generazione della firma
pt:A geração de assinatura
es:La generación de una firma
fr:Génération de la signature
Introduction
During a call to the API, as described in the WIKI of authentication, a signature is required. It is generated based on all of the parameters provided during the call .
For technical reasons and for the moment, the authentication parameters must 'always be transmitted via the HTTP GET method
Example
// Définition des paramètres
$data["login"] = "mail@example.com ";
$data["password"] = "DH 4=674j_G "; // Mot de passe non chiffré
// D"autres paramètres peuvent êtres ajoutés en fonction de l"appel à l"API
// $data["autre_parametre"] = "valeur";
// $data["autre_parametre_2"] = "valeur_2";
// $data["..."] = "...";
// Triage des paramètres dans l'ordre croissant
ksort($data);
// Encodage des paramètres
$query = http_build_query($data);
// Encodage des signes plus
$query = str_replace("+", "%20", $query);
// Transformation de la chaîne de caractères en minuscule
$query = strtolower($query);
// Clé publique d'Ikoula (cf. lien ci-dessus)
$public_key="MIIBIjAN...";
// Hashage des paramètres
$hash = hash_hmac("SHA1", $query, $public_key, true);
// Encodage en base64, puis encodage en URL selon RFC 3986
$signature = rawurlencode(base64_encode($hash));
// ==> $signature contient alors la signature finale
Conclusion
Once the signature is generated, it is necessary to pass it as a parameter (In addition to all the other parameters ) to the API call.
Following the previous example, parameters to pass would have therefore been :
- login = "mail@example.cOM "
- password = "DH 4=674j_G "
- signature = $signature
This article seemed you to be useful ?
Enable comment auto-refresher