Struct tuf::Tuf
[−]
[src]
pub struct Tuf { /* fields omitted */ }
Interface for interacting with TUF repositories.
Methods
impl Tuf
[src]
fn from_root_keys(root_keys: Vec<Key>, config: Config) -> Result<Self, Error>
Create a Tuf
struct from an existing repo with the initial root keys pinned. This also
calls initialize
to ensure the needed paths exist.
fn new(config: Config) -> Result<Self, Error>
Create a Tuf
struct from a new repo. Must contain the root.json
. The root is trusted
with only verification on consistency, not authenticity. This call also calls initialize
to ensure the needed paths exist.
fn initialize(local_path: &PathBuf) -> Result<(), Error>
Create and verify the necessary directory structure for a TUF repo.
fn update(&mut self) -> Result<(), Error>
Update the metadata from local and remote sources.
fn list_targets(&self) -> Vec<String>
Lists all targets that are currently available. If a target is missing, it means the metadata chain that leads to it cannot be verified, and the target is therefore untrusted.
fn fetch_target(&self, target: &str) -> Result<PathBuf, Error>
Reads a target from local storage or fetches it from a remote repository. Verifies the target. Fails if the target is missing, or if the metadata chain that leads to it cannot be verified.