I have a List of X509Certificate2, that I want to validate. I want to verify the following:
- That non of the certificates have expired
- That the root certificate is trusted, if that is possible to check
- That each certificate(except root) is issued by the previous certificate
And also, if possible, check if root certificate is downloaded on the running server/machine.
public bool isValid(List<X509Certificate2> certificates)
{
//Verify that:
// - That non of the certificates have expired
// - That the root certificate is trusted, if that is possible to check
// - That each certificate(except root) is issued by the previous certificate
// - And if possible, check if root certificate is downloaded on the running server/machine
}
So, the example input would be:
SOME ROOT CERTIFICATE
|
SOME SECOND CERTIFICATE ISSUED BY ROOT
|
CERTIFICATE ISSUED BY SECOND CERTIFICATE
Can someone help me out with this?