Botan 2.13.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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 */
21 class BOTAN_PUBLIC_API(2,0) AlgorithmIdentifier final : public ASN1_Object
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
Botan::ASN1_Object
Definition: asn1_obj.h:66
Botan::AlgorithmIdentifier::parameters
std::vector< uint8_t > parameters
Definition: alg_id.h:46
final
int(* final)(unsigned char *, CTX *)
Definition: commoncrypto_hash.cpp:28
BOTAN_PUBLIC_API
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
Botan::AlgorithmIdentifier::Encoding_Option
Encoding_Option
Definition: alg_id.h:24
Botan::DER_Encoder
Definition: der_enc.h:23
Botan
Definition: alg_id.cpp:13
Botan::AlgorithmIdentifier::get_oid
const OID & get_oid() const
Definition: alg_id.h:37
Botan::AlgorithmIdentifier
Definition: alg_id.h:21
Botan::AlgorithmIdentifier::USE_NULL_PARAM
Definition: alg_id.h:24
Botan::OID
Definition: asn1_oid.h:20
Botan::BER_Decoder
Definition: ber_dec.h:21
Botan::AlgorithmIdentifier::get_parameters
const std::vector< uint8_t > & get_parameters() const
Definition: alg_id.h:38