I'm trying to consume an API. I understand that standard classes like HttpUrlConnection from the java.net package can be used. However, the API I'm trying to consume requires me to present a signed certificate provided by them. I currently have obtained the signed certificate but I have no idea how to import it into my API call.
Using POSTMAN, post addition of client certificate, I'm able to consume the API.
POSTMAN Certificate configuration
Can someone help me on how to add this client certificate and Private key to my HTTP Request? If it's not possible using standard lib, please suggest an alternative way.
What you're trying to achieve is called Client Certificate Authentication. In Java, the one of the most popular library used for making HTTP requests is OkHttp.
You can check their instruction about Client Authentication here or see how they implement it in their unit test.