/// Sign the metadata using the given `private_key`, replacing any existing signatures with the
/// same `KeyId`.
///
/// **WARNING**: You should never have multiple TUF private keys on the same machine, so if
/// you're using this to append several signatures at once, you are doing something wrong. The
/// preferred method is to generate your copy of the metadata locally and use
/// `Metablock::merge_signatures` to perform the "append" operations.
Sign the metadata using the given `private_key`, replacing any existing signatures with the
same `KeyId`.

WARNING**: You should never have multiple TUF private keys on the same machine, so if
you're using this to append several signatures at once, you are doing something wrong. The
preferred method is to generate your copy of the metadata locally and use
`Metablock::merge_signatures` to perform the "append" operations.
Sign the metadata using the given ` private_key ` replacing any existing signatures with the same ` KeyId ` . WARNING ** : You should never have multiple TUF private keys on the same machine so if you ' re using this to append several signatures at once you are doing something wrong . The preferred method is to generate your copy of the metadata locally and use ` Metablock :: merge_signatures ` to perform the " append " operations .
pub fn sign(mut self, private_key: &PrivateKey) -> Result<Self> {
        let sig = private_key.sign(&self.metadata_bytes)?;
        let _ = self.signatures.insert(sig.key_id().clone(), sig);
        Ok(self)
    }
pub fn sign ( mut self , private_key : & PrivateKey ) -> Result < Self > { let sig = private_key . sign ( & self . metadata_bytes ) ? ; let _ = self . signatures . insert ( sig . key_id ( ) . clone ( ) , sig ) ; Ok ( self ) }
Sign the metadata using the given `private_key`, replacing any existing signatures with the
same `KeyId`.
Sign the metadata using the given ` private_key ` replacing any existing signatures with the same ` KeyId ` .
mut self
private_key
&PrivateKey