1. Using X509Chain I'm unable to validate certificate. ChainStatus return following statuses
PartialChain: A certificate chain could not be built to a trusted root authority.
RevocationStatusUnknown: The revocation function was unable to check revocation for the certificate.
OfflineRevocation: The revocation function was unable to check revocation because the revocation server was offline.
2. How to validate digiatal signature using System.Security.Cryptograp
hy classes. I tried using RSACryptoServiceProvider. Code sample is bellow.
Does enyone know where is my error, and what am I doing wrong?
Can someone give me URLs with this topic?
X509Certificate2 aCertificate = new X509Certificate2(UnicodeEncoding.Unicode.GetBytes(Signature));
X509Chain chain = new X509Chain();
chain.ChainPolicy.RevocationFlag = X509RevocationFlag.EntireChain;
chain.ChainPolicy.RevocationMode = X509RevocationMode.Online;
chain.ChainPolicy.UrlRetrievalTimeout = new TimeSpan(0, 1, 0);
chain.ChainPolicy.VerificationFlags = X509VerificationFlags.NoFlag;
bool chainIsValid = chain.Build(aCertificate);
byte data = Encoding.Unicode.GetBytes(Data); //original data
SHA1 sha = new SHA1CryptoServiceProvider();
byte hash = sha.ComputeHash(data);
RSACryptoServiceProvider RSAP = (RSACryptoServiceProvider)aCert.PublicKey.Key;
//aCert is X509Certificate2 from code above
RSAPKCS1SignatureDeformatter RSADeformatter = new RSAPKCS1SignatureDeformatter(RSAP);
if (RSADeformatter.VerifySignature(hash, sig))