Aktualizr
C++ SOTA Client
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
Hash Class Reference

The Hash class The hash of a file or Uptane metadata. More...

#include <types.h>

Public Types

enum  Type { kSha256, kSha512, kUnknownAlgorithm }
 

Public Member Functions

 Hash (const std::string &type, const std::string &hash)
 
 Hash (Type type, const std::string &hash)
 
bool HaveAlgorithm () const
 
bool operator== (const Hash &other) const
 
bool operator!= (const Hash &other) const
 
std::string TypeString () const
 
Type type () const
 
std::string HashString () const
 

Static Public Member Functions

static Hash generate (Type type, const std::string &data)
 
static std::string TypeString (Type type)
 
static std::string encodeVector (const std::vector< Hash > &hashes)
 
static std::vector< HashdecodeVector (std::string hashes_str)
 

Friends

std::ostream & operator<< (std::ostream &os, const Hash &h)
 

Detailed Description

The Hash class The hash of a file or Uptane metadata.

File hashes/checksums in Uptane include the length of the object, in order to defeat infinite download attacks.

Definition at line 159 of file types.h.


The documentation for this class was generated from the following files: