Aktualizr
C++ SOTA Client
Public Types | Public Member Functions | List of all members
Uptane::Root Class Reference
Inheritance diagram for Uptane::Root:
[legend]
Collaboration diagram for Uptane::Root:
[legend]

Public Types

enum  Policy { kRejectAll, kAcceptAll, kCheck }
 

Public Member Functions

 Root (Policy policy=Policy::kRejectAll)
 An empty Root, that either accepts or rejects everything.
 
 Root (RepositoryType repo, const Json::Value &json)
 A 'real' root that implements TUF signature validation. More...
 
 Root (RepositoryType repo, const Json::Value &json, Root &root)
 
void UnpackSignedObject (RepositoryType repo, const Json::Value &signed_object)
 Take a JSON blob that contains a signatures/signed component that is supposedly for a given role, and check that is suitably signed. More...
 
bool operator== (const Root &rhs) const
 
- Public Member Functions inherited from Uptane::BaseMeta
 BaseMeta (const Json::Value &json)
 
 BaseMeta (RepositoryType repo, const Json::Value &json, Root &root)
 
int version () const
 
TimeStamp expiry () const
 
bool isExpired (const TimeStamp &now) const
 
Json::Value original () const
 
bool operator== (const BaseMeta &rhs) const
 

Additional Inherited Members

- Protected Attributes inherited from Uptane::BaseMeta
int version_ = {-1}
 
TimeStamp expiry_
 
Json::Value original_object_
 

Detailed Description

Definition at line 252 of file tuf.h.

Constructor & Destructor Documentation

◆ Root()

Root::Root ( RepositoryType  repo,
const Json::Value &  json 
)

A 'real' root that implements TUF signature validation.

Parameters
repo- Repository type (only used to improve the error messages)
json- The contents of the 'signed' portion

Definition at line 13 of file root.cc.

Member Function Documentation

◆ UnpackSignedObject()

void Uptane::Root::UnpackSignedObject ( RepositoryType  repo,
const Json::Value &  signed_object 
)

Take a JSON blob that contains a signatures/signed component that is supposedly for a given role, and check that is suitably signed.

If it is, it returns the contents of the 'signed' part.

It performs the following checks:

  • "_type" matches the given role
  • "expires" is in the past (vs 'now')
  • The blob has valid signatures from enough keys to cross the threshold for this role
    Parameters
    repo- Repository type (only used to improve the error messages)
    signed_object
    Returns

Definition at line 76 of file root.cc.


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