Botan  1.11.15
src/lib/asn1/asn1_alt_name.h
Go to the documentation of this file.
00001 /*
00002 * Common ASN.1 Objects
00003 * (C) 1999-2007 Jack Lloyd
00004 *     2007 Yves Jerschow
00005 *
00006 * Botan is released under the Simplified BSD License (see license.txt)
00007 */
00008 
00009 #ifndef BOTAN_ASN1_ALT_NAME_H__
00010 #define BOTAN_ASN1_ALT_NAME_H__
00011 
00012 #include <botan/asn1_obj.h>
00013 #include <botan/asn1_str.h>
00014 #include <botan/asn1_oid.h>
00015 #include <map>
00016 
00017 namespace Botan {
00018 
00019 /**
00020 * Alternative Name
00021 */
00022 class BOTAN_DLL AlternativeName : public ASN1_Object
00023    {
00024    public:
00025       void encode_into(class DER_Encoder&) const;
00026       void decode_from(class BER_Decoder&);
00027 
00028       std::multimap<std::string, std::string> contents() const;
00029 
00030       void add_attribute(const std::string&, const std::string&);
00031       std::multimap<std::string, std::string> get_attributes() const;
00032 
00033       void add_othername(const OID&, const std::string&, ASN1_Tag);
00034       std::multimap<OID, ASN1_String> get_othernames() const;
00035 
00036       bool has_items() const;
00037 
00038       AlternativeName(const std::string& = "", const std::string& = "",
00039                       const std::string& = "", const std::string& = "");
00040    private:
00041       std::multimap<std::string, std::string> alt_info;
00042       std::multimap<OID, ASN1_String> othernames;
00043    };
00044 
00045 }
00046 
00047 #endif