8 #ifndef BOTAN_ASN1_OID_H_
9 #define BOTAN_ASN1_OID_H_
11 #include <botan/asn1_obj.h>
33 explicit OID(
const std::string& str);
38 explicit OID(std::initializer_list<uint32_t>
init) : m_id(init) {}
50 static OID from_string(
const std::string& str);
52 void encode_into(
class DER_Encoder&)
const override;
59 bool empty()
const {
return m_id.empty(); }
65 bool has_value()
const {
return (m_id.empty() ==
false); }
73 const std::vector<uint32_t>&
get_id()
const {
return get_components(); }
79 std::string BOTAN_DEPRECATED(
"Use OID::to_string") as_string()
const
94 std::string to_formatted_string()
const;
102 return m_id == other.m_id;
108 void BOTAN_DEPRECATED(
"Avoid mutation of OIDs") clear() { m_id.clear(); }
115 BOTAN_DEPRECATED(
"Avoid mutation of OIDs")
OID& operator+=(uint32_t new_comp)
117 m_id.push_back(new_comp);
122 std::vector<uint32_t> m_id;
138 inline
bool operator!=(const
OID& a, const
OID& b)
const std::vector< uint32_t > & get_components() const
OID(std::initializer_list< uint32_t > init)
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
bool operator==(const OID &other) const
std::string to_string(ErrorType type)
Convert an ErrorType to string.
const std::vector< uint32_t > & get_id() const
OID(std::vector< uint32_t > &&init)