Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public bool SHAValidateSign(string originalstring, byte[] fileSignature, byte[] pubKey)
- {
- var cert = new X509Certificate2();
- try
- {
- cert = new X509Certificate2(pubKey, "");
- }
- catch (System.Security.Cryptography.CryptographicException e)
- {
- var a = e.InnerException;
- }
- var rsaCryptoIPT = (RSACryptoServiceProvider)cert.PublicKey.Key;
- var sha1 = new SHA1CryptoServiceProvider();
- ASCIIEncoding encoder = new ASCIIEncoding();
- return (!rsaCryptoIPT.VerifyData(encoder.GetBytes(originalstring), sha1, fileSignature));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement