I need to use an API but first to login I need to create signature.
1. Concatenate the API key with the current timestamp in the format below:
<<APIKEY>>_<<timestamp(yyyy'-'MM'-'ddTHH:mm:ss.fffZ)>>
and this step is easy:
hash('sha256', $data);
result is: 9952375a30708b46739986482303cae30ad51fc9a362b5794d298dfc22f7ec02 and this is correct result
The next step is:
2. The combination of the created signature along with the provided API secret key will act as the
digital signature of the call.
I have API secret key like:
-----BEGIN PUBLIC KEY-----
9IGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCgBSU90PX4WyXFAZ/+M84dJNEi
/0j5OermfydTU4g2JvnpO6BOQjNpb5+mOLjVoij7DWTdDtx1WThRm04N3DVuyh+a
5cledvMbcngvyiXpQCdskT9bVmI4QLbmRny46S7MER1jhziMQRfRw9gbmlB2iCEq
n21kDr842Q+WDtLE4QIDAQA9
-----END PUBLIC KEY-----
How I can get Digital signature with a combination of created signature and provided API secret key?
There is an Python example like:
key = api_key + '_' + timestamp
print "message", key
sha_hash = hashlib.sha256(key).hexdigest()
print "sha256 hash:", sha_hash
rsa_key = RSA.importKey(pub_key)
cipher = PKCS1_v1_5.new(rsa_key)
signature = base64.encodestring(cipher.encrypt(sha_hash))
but how I can get signature using PHP?