public static byte[] GetDiscoveryResponseData(DiscoveryResponse response, ICollection <RemoteAttestation> attestations)
 {
     foreach (RemoteAttestation attestation in attestations)
     {
         if (Enumerable.SequenceEqual(response.RequestId, attestation.RequestId))
         {
             return(AesCipher.Decrypt(attestation.Keys.ServerKey, response.Iv !, response.Data !, response.Mac !));
         }
     }
     throw new NoMatchingRequestIdException();
 }
Пример #2
0
 public static byte[] GetRequestId(RemoteAttestationKeys keys, RemoteAttestationResponse response)
 {
     return(AesCipher.Decrypt(keys.ServerKey, response.Iv, response.Ciphertext, response.Tag));
 }