/* * X.509 Distinguished Name * (C) 1999-2010 Jack Lloyd * * Botan is released under the Simplified BSD License (see license.txt) */ #ifndef BOTAN_X509_DN_H_ #define BOTAN_X509_DN_H_ #include #include #include #include #include namespace Botan { /** * Distinguished Name */ class BOTAN_PUBLIC_API(2,0) X509_DN final : public ASN1_Object { public: void encode_into(class DER_Encoder&) const override; void decode_from(class BER_Decoder&) override; std::multimap get_attributes() const; std::vector get_attribute(const std::string&) const; std::multimap contents() const; void add_attribute(const std::string&, const std::string&); void add_attribute(const OID&, const std::string&); static std::string deref_info_field(const std::string&); std::vector get_bits() const; bool empty() const { return m_dn_info.empty(); } X509_DN() = default; explicit X509_DN(const std::multimap&); explicit X509_DN(const std::multimap&); private: std::multimap m_dn_info; std::vector m_dn_bits; }; bool BOTAN_PUBLIC_API(2,0) operator==(const X509_DN&, const X509_DN&); bool BOTAN_PUBLIC_API(2,0) operator!=(const X509_DN&, const X509_DN&); bool BOTAN_PUBLIC_API(2,0) operator<(const X509_DN&, const X509_DN&); BOTAN_PUBLIC_API(2,0) std::ostream& operator<<(std::ostream& out, const X509_DN& dn); BOTAN_PUBLIC_API(2,0) std::istream& operator>>(std::istream& in, X509_DN& dn); } #endif