Botan  2.4.0
Crypto and TLS for C++11
alg_id.h
Go to the documentation of this file.
1 /*
2 * Algorithm Identifier
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7 
8 #ifndef BOTAN_ALGORITHM_IDENTIFIER_H_
9 #define BOTAN_ALGORITHM_IDENTIFIER_H_
10 
11 #include <botan/asn1_obj.h>
12 #include <botan/asn1_oid.h>
13 #include <string>
14 #include <vector>
15 
16 namespace Botan {
17 
18 /**
19 * Algorithm Identifier
20 */
22  {
23  public:
24  enum Encoding_Option { USE_NULL_PARAM };
25 
26  void encode_into(class DER_Encoder&) const override;
27  void decode_from(class BER_Decoder&) override;
28 
29  AlgorithmIdentifier() = default;
30 
31  AlgorithmIdentifier(const OID& oid, Encoding_Option enc);
32  AlgorithmIdentifier(const std::string& oid_name, Encoding_Option enc);
33 
34  AlgorithmIdentifier(const OID& oid, const std::vector<uint8_t>& params);
35  AlgorithmIdentifier(const std::string& oid_name, const std::vector<uint8_t>& params);
36 
37  const OID& get_oid() const { return oid; }
38  const std::vector<uint8_t>& get_parameters() const { return parameters; }
39 
40  /*
41  * These values are public for historical reasons, but in a future release
42  * they will be made private. Do not access them.
43  */
45  std::vector<uint8_t> parameters;
46  };
47 
48 /*
49 * Comparison Operations
50 */
51 bool BOTAN_PUBLIC_API(2,0) operator==(const AlgorithmIdentifier&,
52  const AlgorithmIdentifier&);
53 bool BOTAN_PUBLIC_API(2,0) operator!=(const AlgorithmIdentifier&,
54  const AlgorithmIdentifier&);
55 
56 }
57 
58 #endif
std::vector< uint8_t > parameters
Definition: alg_id.h:45
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:27
Definition: alg_id.cpp:13
const std::vector< uint8_t > & get_parameters() const
Definition: alg_id.h:38
const OID & get_oid() const
Definition: alg_id.h:37