private static MicrosoftDataEncryptionException ThrowDecryptionFailedException(byte[] encryptionKey, byte[] ciphertext, string reason) { string lastTenBytesOfKey = GetBytesAsString(encryptionKey, startFromEnd: true, countOfBytes: 10); string firstTenBytesOfCiphertext = GetBytesAsString(ciphertext, startFromEnd: false, countOfBytes: 10); throw new MicrosoftDataEncryptionException(DecryptionFailed.Format(lastTenBytesOfKey, firstTenBytesOfCiphertext, reason)); }
internal void OnDecryptionFailed(object message, Exception e) { DecryptionFailed?.Invoke(message, new ClientSideDecryptionFailureEventArgs(e)); }