|
Botan 3.13.0
Crypto and TLS for C&
|
#include <email.h>
Public Member Functions | |
| const DNSName & | domain () const |
| const std::string & | local_part () const |
| The local-part, ASCII only. | |
| auto | operator<=> (const EmailAddress &) const =default |
| bool | operator== (const EmailAddress &) const =default |
| std::string | to_string () const |
Static Public Member Functions | |
| static std::optional< EmailAddress > | from_string (std::string_view addr) |
A parsed email address in mailbox form: "local-part@domain".
This is specifically modeling RFC 5280's rfc822Name GeneralName type. In this type, the local-part of the email address must be an ASCII subset.
This type and SmtpUTF8Mailbox are very similar in that both express mailbox names. However they are modeled as distinct and unrelated types, as certain name constraint processing rules are applied differently to the two name forms, so it is important that they not be confusable. In addition, by a strict reading of the RFCs, the names expressed by EmailAddress and by SmtpUTF8Mailbox are completely disjoint; EmailAddress as encoded can only express ASCII local-part names, and SmtpUTF8Mailbox is RFC MUST required to be used only for names with a non-ASCII local-part.
|
inline |
The domain part of the address
Definition at line 47 of file email.h.
Referenced by operator==().
|
static |
Parse an rfc822Name mailbox
| addr | the address to parse |
Definition at line 78 of file email.cpp.
Referenced by Botan::AlternativeName::add_email(), Botan::NameConstraints::is_excluded(), Botan::NameConstraints::is_permitted(), and Botan::X509_Certificate::subject_email_addresses().
|
inline |
The local-part, ASCII only.
Definition at line 43 of file email.h.
Referenced by operator==().
|
default |
Order two addresses
|
default |
Compare two addresses
References domain(), and local_part().
| std::string Botan::EmailAddress::to_string | ( | ) | const |
Format the address as "local-part@domain"
Definition at line 73 of file email.cpp.
References Botan::fmt().