Coverage Report

Created: 2020-05-23 13:54

/src/botan/build/include/botan/alg_id.h
Line
Count
Source
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
74.7k
      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
86.4k
      const OID& get_oid() const { return oid; }
38
53.7k
      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