Difference between revisions of "The signature generation"
| Line 1: | Line 1: | ||
| + | <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_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_nl_title="De handtekening generatie" data-link_translate_nl_url="De+handtekening+generatie"></span>[[:nl:De handtekening generatie]][[nl:De handtekening generatie]] | ||
Revision as of 17:30, 29 October 2015
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
This article has been created by an automatic translation software. You can view the article source here.
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, the authentication settings must for the mOM ent 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 ) 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