aboutsummaryrefslogtreecommitdiffstats
path: root/include/asn1_int.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-05-19 00:07:25 +0000
committerlloyd <[email protected]>2006-05-19 00:07:25 +0000
commitf090e030be53e574fecbe7cf50edfb5fdacb53e1 (patch)
tree0bff0c249a9dbcb674fcd2491ab17e3d123ef1f9 /include/asn1_int.h
parenta0af7b26591f8fb79d1f06fe42548e1eb0c35e90 (diff)
Syntax changes to the BER and DER APIs to improve readability of code
that uses them. These changes are not backwards compatible, this commit updates all uses of the APIs within the library.
Diffstat (limited to 'include/asn1_int.h')
-rw-r--r--include/asn1_int.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/include/asn1_int.h b/include/asn1_int.h
index 40ddbb444..85f763f26 100644
--- a/include/asn1_int.h
+++ b/include/asn1_int.h
@@ -6,8 +6,9 @@
#ifndef BOTAN_ASN1_H__
#define BOTAN_ASN1_H__
-#include <botan/bigint.h>
+#include <botan/secmem.h>
#include <botan/enums.h>
+#include <botan/exceptn.h>
namespace Botan {
@@ -18,10 +19,23 @@ class ASN1_Object
{
public:
virtual void encode_into(class DER_Encoder&) const = 0;
+ virtual void decode_from(class BER_Decoder&) = 0;
virtual ~ASN1_Object() {}
};
/*************************************************
+* BER Encoded Object *
+*************************************************/
+class BER_Object
+ {
+ public:
+ void assert_is_a(ASN1_Tag, ASN1_Tag);
+
+ ASN1_Tag type_tag, class_tag;
+ SecureVector<byte> value;
+ };
+
+/*************************************************
* ASN.1 Utility Functions *
*************************************************/
class DataSource;
@@ -29,6 +43,7 @@ class DataSource;
namespace ASN1 {
SecureVector<byte> put_in_sequence(const MemoryRegion<byte>&);
+std::string to_string(const BER_Object&);
bool maybe_BER(DataSource&);
}