public ProofKeysHelper(KeyInfo current, KeyInfo old) { _currentKey = current; _oldKey = old; }
private static bool TryVerification(byte[] expectedProof, string signedProof, KeyInfo keyToTry) { using (RSACryptoServiceProvider rsaAlg = new RSACryptoServiceProvider()) { try { rsaAlg.ImportCspBlob(Convert.FromBase64String(keyToTry.Key)); return rsaAlg.VerifyData(expectedProof, "SHA256", Convert.FromBase64String(signedProof)); } catch (FormatException) { return false; } catch (CryptographicException) { return false; } } }
private static bool TryVerification(byte[] expectedProof, string signedProof, KeyInfo keyToTry) { using (RSACryptoServiceProvider rsaAlg = new RSACryptoServiceProvider()) { try { rsaAlg.ImportCspBlob(Convert.FromBase64String(keyToTry.Key)); return(rsaAlg.VerifyData(expectedProof, "SHA256", Convert.FromBase64String(signedProof))); } catch (FormatException) { return(false); } catch (CryptographicException) { return(false); } } }