<PackageReference Include="BouncyCastle.Cryptography" Version="2.6.2" />

TlsFatalAlertReceived

using System; using System.Runtime.Serialization; namespace Org.BouncyCastle.Tls { [Serializable] public class TlsFatalAlertReceived : TlsException { protected readonly byte m_alertDescription; public virtual short AlertDescription => m_alertDescription; public TlsFatalAlertReceived(short alertDescription) : base(Org.BouncyCastle.Tls.AlertDescription.GetText(alertDescription)) { if (!TlsUtilities.IsValidUint8(alertDescription)) throw new ArgumentOutOfRangeException("alertDescription"); m_alertDescription = (byte)alertDescription; } protected TlsFatalAlertReceived(SerializationInfo info, StreamingContext context) : base(info, context) { m_alertDescription = info.GetByte("alertDescription"); } public override void GetObjectData(SerializationInfo info, StreamingContext context) { base.GetObjectData(info, context); info.AddValue("alertDescription", m_alertDescription); } } }