~ubuntu-branches/debian/sid/botan/sid

« back to all changes in this revision

Viewing changes to src/lib/x509/asn1_alt_name.h

  • Committer: Package Import Robot
  • Author(s): Laszlo Boszormenyi (GCS)
  • Date: 2018-03-01 22:23:25 UTC
  • mfrom: (1.2.2)
  • Revision ID: package-import@ubuntu.com-20180301222325-7p7vc45gu3hta34d
Tags: 2.4.0-2
* Don't remove .doctrees from the manual if it doesn't exist.
* Don't specify parallel to debhelper.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 <map>
 
15
 
 
16
namespace Botan {
 
17
 
 
18
/**
 
19
* Alternative Name
 
20
*/
 
21
class BOTAN_PUBLIC_API(2,0) AlternativeName final : public ASN1_Object
 
22
   {
 
23
   public:
 
24
      void encode_into(class DER_Encoder&) const override;
 
25
      void decode_from(class BER_Decoder&) override;
 
26
 
 
27
      std::multimap<std::string, std::string> contents() const;
 
28
 
 
29
      bool has_field(const std::string& attr) const;
 
30
      std::vector<std::string> get_attribute(const std::string& attr) const;
 
31
 
 
32
      std::string get_first_attribute(const std::string& attr) const;
 
33
 
 
34
      void add_attribute(const std::string& type, const std::string& value);
 
35
      void add_othername(const OID& oid, const std::string& value, ASN1_Tag type);
 
36
 
 
37
      const std::multimap<std::string, std::string>& get_attributes() const
 
38
         {
 
39
         return m_alt_info;
 
40
         }
 
41
 
 
42
      const std::multimap<OID, ASN1_String>& get_othernames() const
 
43
         {
 
44
         return m_othernames;
 
45
         }
 
46
 
 
47
      bool has_items() const;
 
48
 
 
49
      AlternativeName(const std::string& email_addr = "",
 
50
                      const std::string& uri = "",
 
51
                      const std::string& dns = "",
 
52
                      const std::string& ip_address = "");
 
53
   private:
 
54
      std::multimap<std::string, std::string> m_alt_info;
 
55
      std::multimap<OID, ASN1_String> m_othernames;
 
56
   };
 
57
 
 
58
}
 
59
 
 
60
#endif