Module tough::schema

source ·
Expand description

Provides the schema objects as defined by the TUF spec.

Modules

  • Provides a wrapper and traits for abstracting over decoded keys or different types.
  • Handles cryptographic keys and their serialization in TUF metadata files.

Structs

  • Each role delegated in a targets file is considered a delegated role
  • Wrapper for Targets so that a Targets role can be given a name
  • Delegations are found in a targets.json file. TUF 4.5: DELEGATIONS is an object whose format is the following:
  • Provides a Transport for local files.
  • Represents the hash dictionary in a snapshot.json file.
  • The first characters found in the string representation of a sha256 digest. This can be used for randomly sharding a repository. See [PathSet::PathHashDigest] for the description of how this is used.
  • A glob-like path pattern for matching delegated targets, e.g. foo/bar/*.
  • Represents the key IDs used for a role and the threshold of signatures required to validate it. TUF 4.3: A ROLE is one of “root”, “snapshot”, “targets”, “timestamp”, or “mirrors”. A role for each of “root”, “snapshot”, “timestamp”, and “targets” MUST be specified in the key list. The role of “mirror” is optional. If not specified, the mirror list will not need to be signed if mirror lists are being used. The THRESHOLD for a role is an integer of the number of keys of that role whose signatures are required in order to consider a file as being properly signed by that role.
  • TUF 4.3: The root.json file is signed by the root role’s keys. It indicates which keys are authorized for all top-level roles, including the root role itself. Revocation and replacement of top-level role keys, including for the root role, is done by changing the keys listed for the roles in this file.
  • A signature and the key ID that made it.
  • A signed metadata object.
  • TUF 4.4 The snapshot.json file is signed by the snapshot role. It MUST list the version numbers of the top-level targets metadata and all delegated targets metadata. It MAY also list their lengths and file hashes.
  • Represents a metadata file in a snapshot.json file. TUF 4.4: METAFILES is an object whose format is the following:
  • TUF 4.5: TARGETS is an object whose format is the following:
  • Represents a targets.json file. TUF 4.5: The “signed” portion of targets.json is as follows:
  • Represents a timestamp.json file. TUF 4.6: The timestamp file is signed by a timestamp key. It indicates the latest version of the snapshot metadata and is frequently resigned to limit the amount of time a client can be kept unaware of interference with obtaining updates.
  • METAFILES is the same as described for the snapshot.json file. In the case of the timestamp.json file, this MUST only include a description of the snapshot.json file.

Enums

  • The error type for this library.
  • A KeyHolder is metadata that is responsible for verifying the signatures of a role. KeyHolder contains either a Delegations of a Targets or a Root
  • Specifies the target paths that a delegated role controls.
  • A role identifier
  • The type of metadata role.

Traits

  • Common trait implemented by all roles.
  • A trait to abstract over the method/protocol by which files are obtained.

Type Definitions

  • Alias for Result<T, Error>.