public bool ValidateSignature <T>(T command, string publicKey, string digitalSignature) where T : IRestrictedCommand { var key = Encoding.ASCII.GetBytes(_keyGenerator.GenerateKeyForPKI(command)); var verifier = new DSACryptoServiceProvider(); var hashByte = Encoding.ASCII.GetBytes(digitalSignature); var isValid = verifier.VerifyData(key, hashByte); return(isValid); }