Botan
1.11.15
|
00001 /* 00002 * OID Registry 00003 * (C) 1999-2007 Jack Lloyd 00004 * 00005 * Botan is released under the Simplified BSD License (see license.txt) 00006 */ 00007 00008 #ifndef BOTAN_OIDS_H__ 00009 #define BOTAN_OIDS_H__ 00010 00011 #include <botan/asn1_oid.h> 00012 00013 namespace Botan { 00014 00015 namespace OIDS { 00016 00017 /** 00018 * Register an OID to string mapping. 00019 * @param oid the oid to register 00020 * @param name the name to be associated with the oid 00021 */ 00022 BOTAN_DLL void add_oid(const OID& oid, const std::string& name); 00023 00024 BOTAN_DLL void add_oid2str(const OID& oid, const std::string& name); 00025 BOTAN_DLL void add_str2oid(const OID& oid, const std::string& name); 00026 00027 BOTAN_DLL void add_oidstr(const char* oidstr, const char* name); 00028 00029 /** 00030 * See if an OID exists in the internal table. 00031 * @param oid the oid to check for 00032 * @return true if the oid is registered 00033 */ 00034 BOTAN_DLL bool have_oid(const std::string& oid); 00035 00036 /** 00037 * Resolve an OID 00038 * @param oid the OID to look up 00039 * @return name associated with this OID 00040 */ 00041 BOTAN_DLL std::string lookup(const OID& oid); 00042 00043 /** 00044 * Find the OID to a name. The lookup will be performed in the 00045 * general OID section of the configuration. 00046 * @param name the name to resolve 00047 * @return OID associated with the specified name 00048 */ 00049 BOTAN_DLL OID lookup(const std::string& name); 00050 00051 /** 00052 * Tests whether the specified OID stands for the specified name. 00053 * @param oid the OID to check 00054 * @param name the name to check 00055 * @return true if the specified OID stands for the specified name 00056 */ 00057 BOTAN_DLL bool name_of(const OID& oid, const std::string& name); 00058 00059 BOTAN_DLL const char* default_oid_list(); 00060 00061 } 00062 00063 } 00064 00065 #endif