Get SSL Certificate expiration date from client-cert.pem file stored locally in Android

  

If I wanted to check the expiration date of a SSL certificate I can use IdHTTP connected to a IdSSLIOHandlerSocketOpenSSL

IdHTTP1.IOHandler := IdSSLIOHandlerSocketOpenSSL1;

And then tapping into OnVerifyPeer

function TForm1.IdSSLIOHandlerSocketOpenSSL1VerifyPeer(Certificate: TIdX509;
AOk: Boolean; ADepth, AError: Integer): Boolean;
begin
Showmessage(Certificate.notAfter));
end;

And finally doing a IdHTTP.Get to the server I want to retrieve the server certificate of, and this works.

BUT

I have a client certificate stored locally on my Android device that gets deployed with the App, how would I access the Certificate?

meaning how would I get the certificate loaded into a TidX509 Object?
the constructor for TidX509 requires a PX509 which is then assigned to a pointer of a record X509 so I am very lost in there

Comments are closed.