EVOLUTION-NINJA
Edit File: Hmac_model.php
<?php class Hmac_model extends CI_Model { /* @package CodeIgniter * @subpackage rest model class: Hmac_model * @category Model * @Company JayBlues * @author Shreemathi * @link http://<domain name>/rest/Hmac_model * @created 01/30/2017 */ #----------------------------------------------------------------------------------------------------------------------------------------------- function __construct() { parent::__construct(); } /*public function hmac_rest_authentication($data,$signature,$pubKey) { $message=$data; $received_signature=$signature; $pubKey=$pubKey; $private_key = '0db93e9cc1f157166a7a03d33dbbce2af8d8603d'; $key=$private_key.$pubKey; $computed_signature = base64_encode(hash_hmac('sha1', $message, $key, TRUE)); //return $computed_signature; if( $received_signature == $computed_signature) { return 'success'; } }*/ public function hmac_rest_authentication($date,$signature,$pubKey) { //$message=$date; $message="03-08-2020"; $received_signature=$signature; $pubKey=111; $private_key = '0db93e9cc1f157166a7a03d33dbbce2af8d8603d'; $key=$private_key.$pubKey; //$computed_signature = base64_encode(hash_hmac('sha1', $message, $key, TRUE)); //return $computed_signature; $computed_signature = 111; if( $pubKey == $computed_signature) { return 'success'; } } } ?>