public ProofKeysHelper(KeyInfo current, KeyInfo old)
 {
     _currentKey = current;
     _oldKey = old;
 }
Exemplo n.º 2
0
 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;
         }
     }
 }
Exemplo n.º 4
0
 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);
         }
     }
 }