Botan  2.7.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, USE_EMPTY_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  BOTAN_DEPRECATED_PUBLIC_MEMBER_VARIABLES:
41  /*
42  * These values are public for historical reasons, but in a future release
43  * they will be made private. Do not access them.
44  */
45  OID oid;
46  std::vector<uint8_t> parameters;
47  };
48 
49 /*
50 * Comparison Operations
51 */
52 bool BOTAN_PUBLIC_API(2,0) operator==(const AlgorithmIdentifier&,
53  const AlgorithmIdentifier&);
54 bool BOTAN_PUBLIC_API(2,0) operator!=(const AlgorithmIdentifier&,
55  const AlgorithmIdentifier&);
56 
57 }
58 
59 #endif
std::vector< uint8_t > parameters
Definition: alg_id.h:46
#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