Botan 3.14.1
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 215 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 229 of file pkix_enums.h.

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

Constructor & Destructor Documentation

◆ ReasonFlags() [1/2]

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

Definition at line 246 of file pkix_enums.h.

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

References ReasonFlags().

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

◆ ReasonFlags() [2/2]

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

Definition at line 248 of file pkix_enums.h.

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

References DefinedReasonBits.

Member Function Documentation

◆ includes() [1/2]

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

Definition at line 261 of file pkix_enums.h.

261{ 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 259 of file pkix_enums.h.

259{ 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 263 of file pkix_enums.h.

263{ return m_value; }

Member Data Documentation

◆ DefinedReasonBits

uint16_t Botan::ReasonFlags::DefinedReasonBits
staticconstexpr

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