pub fn from_trusted_metadata(metadata_set: &RawSignedMetadataSet<D>) -> Result<Self> {
        let mut db = if let Some(root) = metadata_set.root() {
            Database::from_trusted_root(root)?
        } else {
            return Err(Error::MissingMetadata(Role::Root));
        };

        db.update_metadata_after_root(metadata_set)?;

        Ok(db)
    }
/// Create a new [`Database`] struct from a set of metadata that is assumed to be trusted.
///
/// **WARNING**: This is trust-on-first-use (TOFU) and offers weaker security guarantees than
/// the related method [`Database::from_metadata_with_trusted_keys`] because this method needs
/// to deserialize the root metadata from `metadata_set` before we have verified it has been
/// signed properly. This exposes us to potential parser exploits. This method should only be
/// used if the metadata is loaded from a trusted source.
Create a new [`Database`] struct from a set of metadata that is assumed to be trusted.
WARNING**: This is trust-on-first-use (TOFU) and offers weaker security guarantees than
the related method [`Database::from_metadata_with_trusted_keys`] because this method needs
to deserialize the root metadata from `metadata_set` before we have verified it has been
signed properly. This exposes us to potential parser exploits. This method should only be
used if the metadata is loaded from a trusted source.
Create a new [ ` Database ` ] struct from a set of metadata that is assumed to be trusted . WARNING ** : This is trust - on - first - use ( TOFU ) and offers weaker security guarantees than the related method [ ` Database :: from_metadata_with_trusted_keys ` ] because this method needs to deserialize the root metadata from ` metadata_set ` before we have verified it has been signed properly . This exposes us to potential parser exploits . This method should only be used if the metadata is loaded from a trusted source .
pub fn from_trusted_metadata(metadata_set: &RawSignedMetadataSet<D>) -> Result<Self> {
        let mut db = if let Some(root) = metadata_set.root() {
            Database::from_trusted_root(root)?
        } else {
            return Err(Error::MissingMetadata(Role::Root));
        };
        db.update_metadata_after_root(metadata_set)?;
        Ok(db)
    }
pub fn from_trusted_metadata ( metadata_set : & RawSignedMetadataSet < D > ) -> Result < Self > { let mut db = if let Some ( root ) = metadata_set . root ( ) { Database :: from_trusted_root ( root ) ? } else { return Err ( Error :: MissingMetadata ( Role :: Root ) ) ; } ; db . update_metadata_after_root ( metadata_set ) ? ; Ok ( db ) }
Create a new [`Database`] struct from a set of metadata that is assumed to be trusted.
Create a new [ ` Database ` ] struct from a set of metadata that is assumed to be trusted .
metadata_set
&RawSignedMetadataSet<D>
metadata_set
&RawSignedMetadataSet<D>