Botan  2.4.0
Crypto and TLS for C++11
oids.h
Go to the documentation of this file.
1 /*
2 * OID Registry
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7 
8 #ifndef BOTAN_OIDS_H_
9 #define BOTAN_OIDS_H_
10 
11 #include <botan/asn1_oid.h>
12 
13 namespace Botan {
14 
15 namespace OIDS {
16 
17 /**
18 * Resolve an OID
19 * @param oid the OID to look up
20 * @return name associated with this OID
21 */
22 BOTAN_PUBLIC_API(2,0) std::string lookup(const OID& oid);
23 
24 /**
25 * Find the OID to a name. The lookup will be performed in the
26 * general OID section of the configuration.
27 * @param name the name to resolve
28 * @return OID associated with the specified name
29 */
30 BOTAN_PUBLIC_API(2,0) OID lookup(const std::string& name);
31 
32 inline std::string oid2str(const OID& oid)
33  {
34  return lookup(oid);
35  }
36 
37 inline OID str2oid(const std::string& name)
38  {
39  return lookup(name);
40  }
41 
42 /**
43 * See if an OID exists in the internal table.
44 * @param oid the oid to check for
45 * @return true if the oid is registered
46 */
47 inline bool have_oid(const std::string& oid)
48  {
49  return (lookup(oid).empty() == false);
50  }
51 
52 }
53 
54 }
55 
56 #endif
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:27
Definition: bigint.h:635
OID str2oid(const std::string &name)
Definition: oids.h:37
Definition: alg_id.cpp:13
bool have_oid(const std::string &oid)
Definition: oids.h:47
std::string oid2str(const OID &oid)
Definition: oids.h:32
std::string lookup(const OID &oid)
Definition: oids.cpp:18