Botan  1.11.15
src/lib/asn1/alg_id.h
Go to the documentation of this file.
00001 /*
00002 * Algorithm Identifier
00003 * (C) 1999-2007 Jack Lloyd
00004 *
00005 * Botan is released under the Simplified BSD License (see license.txt)
00006 */
00007 
00008 #ifndef BOTAN_ALGORITHM_IDENTIFIER_H__
00009 #define BOTAN_ALGORITHM_IDENTIFIER_H__
00010 
00011 #include <botan/asn1_obj.h>
00012 #include <botan/asn1_oid.h>
00013 #include <string>
00014 
00015 namespace Botan {
00016 
00017 /**
00018 * Algorithm Identifier
00019 */
00020 class BOTAN_DLL AlgorithmIdentifier : public ASN1_Object
00021    {
00022    public:
00023       enum Encoding_Option { USE_NULL_PARAM };
00024 
00025       void encode_into(class DER_Encoder&) const;
00026       void decode_from(class BER_Decoder&);
00027 
00028       AlgorithmIdentifier() {}
00029       AlgorithmIdentifier(const OID&, Encoding_Option);
00030       AlgorithmIdentifier(const std::string&, Encoding_Option);
00031 
00032       AlgorithmIdentifier(const OID&, const std::vector<byte>&);
00033       AlgorithmIdentifier(const std::string&, const std::vector<byte>&);
00034 
00035       OID oid;
00036       std::vector<byte> parameters;
00037    };
00038 
00039 /*
00040 * Comparison Operations
00041 */
00042 bool BOTAN_DLL operator==(const AlgorithmIdentifier&,
00043                           const AlgorithmIdentifier&);
00044 bool BOTAN_DLL operator!=(const AlgorithmIdentifier&,
00045                           const AlgorithmIdentifier&);
00046 
00047 }
00048 
00049 #endif