aboutsummaryrefslogtreecommitdiffstats
path: root/include/asn1_oid.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-05-18 18:33:19 +0000
committerlloyd <[email protected]>2006-05-18 18:33:19 +0000
commita2c99d3270eb73ef2db5704fc54356c6b75096f8 (patch)
treead3d6c4fcc8dd0f403f8105598943616246fe172 /include/asn1_oid.h
Initial checkin1.5.6
Diffstat (limited to 'include/asn1_oid.h')
-rw-r--r--include/asn1_oid.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/include/asn1_oid.h b/include/asn1_oid.h
new file mode 100644
index 000000000..b2bdd4867
--- /dev/null
+++ b/include/asn1_oid.h
@@ -0,0 +1,49 @@
+/*************************************************
+* ASN.1 OID Header File *
+* (C) 1999-2006 The Botan Project *
+*************************************************/
+
+#ifndef BOTAN_ASN1_OID_H__
+#define BOTAN_ASN1_OID_H__
+
+#include <botan/asn1_int.h>
+#include <string>
+#include <vector>
+
+namespace Botan {
+
+/*************************************************
+* ASN.1 Object Identifier *
+*************************************************/
+class OID : public ASN1_Object
+ {
+ public:
+ void encode_into(class DER_Encoder&) const;
+
+ bool is_empty() const { return id.size() == 0; }
+ std::vector<u32bit> get_id() const { return id; }
+ std::string as_string() const;
+
+ bool operator==(const OID&) const;
+ void clear();
+
+ OID& operator+=(u32bit);
+ OID(const std::string& = "");
+ private:
+ std::vector<u32bit> id;
+ };
+
+/*************************************************
+* Append another component onto the OID *
+*************************************************/
+OID operator+(const OID&, u32bit);
+
+/*************************************************
+* Compare two OIDs *
+*************************************************/
+bool operator!=(const OID&, const OID&);
+bool operator<(const OID&, const OID&);
+
+}
+
+#endif