How to create signature using the previously created key and secret for access rest-api

296 Views Asked by At

Currently, I am working on an API where only the access key and secret key are available. To access their API I need to generate the signature in algorithm="hmac-sha256.

They have some python code as an example like

response = requests.post('https://' + host + url_path,
                         json=body,
                         auth=HTTPSignatureAuth(algorithm="hmac-sha256",
                                                key=b64decode(key_secret_id),
                                                key_id=key_id,
                                                headers=[
                                                    '(request-target)', 'host',
                                                    'date', 'content-type',
                                                    'content-length'
                                                ]),
                         headers=headers)

But I am trying to access it using java and not getting any good library or suggestion to do same.

It will be very helpful if someone help me or suggest me any solution..

0

There are 0 best solutions below