Coverage Report

Created: 2020-06-30 13:58

/src/botan/build/include/botan/asn1_alt_name.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
* (C) 1999-2007 Jack Lloyd
3
*     2007 Yves Jerschow
4
*
5
* Botan is released under the Simplified BSD License (see license.txt)
6
*/
7
8
#ifndef BOTAN_X509_ALT_NAME_H_
9
#define BOTAN_X509_ALT_NAME_H_
10
11
#include <botan/asn1_obj.h>
12
#include <botan/asn1_str.h>
13
#include <botan/asn1_oid.h>
14
#include <botan/x509_dn.h>
15
#include <map>
16
17
namespace Botan {
18
19
/**
20
* Alternative Name
21
*/
22
class BOTAN_PUBLIC_API(2,0) AlternativeName final : public ASN1_Object
23
   {
24
   public:
25
      void encode_into(class DER_Encoder&) const override;
26
      void decode_from(class BER_Decoder&) override;
27
28
      std::multimap<std::string, std::string> contents() const;
29
30
      bool has_field(const std::string& attr) const;
31
      std::vector<std::string> get_attribute(const std::string& attr) const;
32
33
      std::string get_first_attribute(const std::string& attr) const;
34
35
      void add_attribute(const std::string& type, const std::string& value);
36
      void add_othername(const OID& oid, const std::string& value, ASN1_Tag type);
37
38
      const std::multimap<std::string, std::string>& get_attributes() const
39
0
         {
40
0
         return m_alt_info;
41
0
         }
42
43
      const std::multimap<OID, ASN1_String>& get_othernames() const
44
0
         {
45
0
         return m_othernames;
46
0
         }
47
48
      X509_DN dn() const;
49
50
      bool has_items() const;
51
52
      AlternativeName(const std::string& email_addr = "",
53
                      const std::string& uri = "",
54
                      const std::string& dns = "",
55
                      const std::string& ip_address = "");
56
   private:
57
      std::multimap<std::string, std::string> m_alt_info;
58
      std::multimap<OID, ASN1_String> m_othernames;
59
   };
60
61
}
62
63
#endif