Botan 1.10.17

Public Member Functions | List of all members
Botan::Alert Class Reference

`#include <tls_alerts.h>`

## Public Member Functions
| Alert (const MemoryRegion< byte > &buf)
bool | is_fatal () const
Alert_Type | type () const

## Detailed Description

SSL/TLS Alert Message

Definition at line 18 of file tls_alerts.h.

## Constructor & Destructor Documentation

## ◆ Alert()

Botan::Alert::Alert | ( | const MemoryRegion< byte > & | buf | ) |
| inline

Deserialize an Alert message

Parameters

  buf | the serialized alert

Definition at line 35 of file tls_alerts.h.

References Botan::MemoryRegion< T >::size().

36 {
37 if(buf.size() != 2)
38 throw Decoding_Error("Alert: Bad size for alert message");
39
40 if(buf[0] == 1) fatal = false;
41 else if(buf[0] == 2) fatal = true;
42 else
43 throw Decoding_Error("Alert: Bad type code for alert level");
44
45 type_code = static_cast<Alert_Type>(buf[1]);
46 }
Botan::Alert_Type
Alert_Type
Definition: tls_magic.h:62
Botan::MemoryRegion::size
size_t size() const
Definition: secmem.h:29

## Member Function Documentation

## ◆ is_fatal()

bool Botan::Alert::is_fatal | ( |  | ) | const
| inline

Returns
  if this alert is a fatal one or not

Definition at line 24 of file tls_alerts.h.

24 { return fatal; }

## ◆ type()

Alert_Type Botan::Alert::type | ( |  | ) | const
| inline

Returns
  type of alert

Definition at line 29 of file tls_alerts.h.

29 { return type_code; }

The documentation for this class was generated from the following file:

- src/ssl/tls_alerts.h