Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static bool VerifyCertificateChain(ArrayList certChain, byte[] leaf)
- {
- X509Chain chain = new X509Chain();
- chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck; // not checking revocation for now
- // Here I add all offline certificates.
- foreach(byte[] cert in certChain)
- {
- chain.ChainPolicy.ExtraStore.Add(new X509Certificate2(cert));
- }
- bool ret = chain.Build(new X509Certificate2(leaf));
- // Always false for me.
- if(!ret)
- {
- // Here I get PartialChain status even though the chain is complete
- // since the rest of the chain is available online.
- foreach(X509ChainStatus status in chain.ChainStatus)
- {
- Console.WriteLine(status.ToString() + " - " + status.StatusInformation);
- }
- }
- return ret;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement