Botan 3.13.0
Crypto and TLS for C&
Botan::ReasonFlags Class Referencefinal

#include <pkix_enums.h>

Public Types

enum  Bits : uint16_t {
  None = 0 , KeyCompromise = 1 << 7 , CaCompromise = 1 << 6 , AffiliationChanged = 1 << 5 ,
  Superseded = 1 << 4 , CessationOfOperation = 1 << 3 , CertificateHold = 1 << 2 , PrivilegeWithdrawn = 1 << 1 ,
  AaCompromise = 1 << 0
}

Public Member Functions

bool includes (ReasonFlags other) const
bool includes (ReasonFlags::Bits other) const
bool operator== (const ReasonFlags &) const =default
 ReasonFlags (ReasonFlags::Bits bits)
 ReasonFlags (uint16_t bits)
uint16_t value () const

Static Public Attributes

static constexpr uint16_t DefinedReasonBits

Detailed Description

X.509 ReasonFlags BIT STRING used by CRLDistributionPoints and IssuingDistributionPoint (RFC 5280 4.2.1.13 / 5.2.5).

Definition at line 214 of file pkix_enums.h.

Member Enumeration Documentation

◆ Bits

enum Botan::ReasonFlags::Bits : uint16_t
Enumerator
None 
KeyCompromise 
CaCompromise 
AffiliationChanged 
Superseded 
CessationOfOperation 
CertificateHold 
PrivilegeWithdrawn 
AaCompromise 

Definition at line 228 of file pkix_enums.h.

228 : uint16_t /* NOLINT(*-use-enum-class,performance-enum-size) */ {
229 None = 0,
230 KeyCompromise = 1 << 7,
231 CaCompromise = 1 << 6,
232 AffiliationChanged = 1 << 5,
233 Superseded = 1 << 4,
234 CessationOfOperation = 1 << 3,
235 CertificateHold = 1 << 2,
236 PrivilegeWithdrawn = 1 << 1,
237 AaCompromise = 1 << 0,
238 };

Constructor & Destructor Documentation

◆ ReasonFlags() [1/2]

Botan::ReasonFlags::ReasonFlags ( ReasonFlags::Bits bits)
inline

Definition at line 245 of file pkix_enums.h.

245: ReasonFlags(static_cast<uint16_t>(bits)) {}
ReasonFlags(ReasonFlags::Bits bits)
Definition pkix_enums.h:245

References ReasonFlags().

Referenced by includes(), operator==(), and ReasonFlags().

◆ ReasonFlags() [2/2]

Botan::ReasonFlags::ReasonFlags ( uint16_t bits)
inlineexplicit

Definition at line 247 of file pkix_enums.h.

247 : m_value(bits) {
248 if((m_value & static_cast<uint16_t>(~DefinedReasonBits)) != 0) {
249 throw Decoding_Error("ReasonFlags contains undefined reason bits");
250 }
251 if(m_value == 0) {
252 throw Decoding_Error("ReasonFlags must have at least one defined reason");
253 }
254 }
static constexpr uint16_t DefinedReasonBits
Definition pkix_enums.h:240

References DefinedReasonBits.

Member Function Documentation

◆ includes() [1/2]

bool Botan::ReasonFlags::includes ( ReasonFlags other) const
inline

Definition at line 260 of file pkix_enums.h.

260{ return (m_value & other.m_value) == other.m_value; }

References ReasonFlags().

◆ includes() [2/2]

bool Botan::ReasonFlags::includes ( ReasonFlags::Bits other) const
inline

Definition at line 258 of file pkix_enums.h.

258{ return (m_value & other) == other; }

◆ operator==()

bool Botan::ReasonFlags::operator== ( const ReasonFlags & ) const
default

References ReasonFlags().

◆ value()

uint16_t Botan::ReasonFlags::value ( ) const
inline

Definition at line 262 of file pkix_enums.h.

262{ return m_value; }

Member Data Documentation

◆ DefinedReasonBits

uint16_t Botan::ReasonFlags::DefinedReasonBits
staticconstexpr

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