pub fn build(&mut self) -> Result<Signature, Error> {
        // Emit correct "rerun-if-changed" diagnostics for cargo
        for package in self.staticlib.packages.iter() {
            // source.is_none implies a local package not from crates.io
            if package.source.is_none() {
                // package.manifest_path has form foo/Cargo.toml, we want to take parent
                // so that we walk the directory containing Cargo.toml
                package.manifest_path.parent().map(rerun_if_path_changed);
            }
        }

        let css_path = if let Some(css) = &self.css {
            rerun_if_changed!(css.as_os_str().to_str().expect("Invalid UTF-8 in CSS path"));
            css.canonicalize()?
        } else {
            let mut css_path = self.out_dir.join(&self.name);
            css_path.set_extension("css");
            self.create_css(&css_path)?;
            css_path
        };

        rustc_env!(
            "MCBUILD_ENCLAVE_CSS_PATH",
            "{}",
            css_path
                .as_os_str()
                .to_str()
                .expect("Invalid UTF-8 in CSS path")
        );

        let retval = Signature::try_from(fs::read(&css_path)?.as_slice())?;

        // Treat the CSS file as an artifact for future builds
        let mut artifact = self.profile_target_dir.join(&self.name);
        artifact.set_extension("css");
        if css_path != artifact {
            fs::copy(&css_path, artifact)?;
        }

        Ok(retval)
    }
/// This method will extract the signature from a signed enclave sigstruct dump.
///
/// If the dump is not found, it will try to extract one from a signed enclave, either in the
/// output dir or specified in the builder.
///
/// If a signed enclave is not found, it will try to combine a pre-staged signature, pubkey,
/// generated data, and unsigned enclave.
///
/// If the signature, pubkey, or generated data do not exist, it will generate a new private
/// key and sign an unsigned enclave.
///
/// If an unsigned enclave does not exist, it will build it.
This method will extract the signature from a signed enclave sigstruct dump.
If the dump is not found, it will try to extract one from a signed enclave, either in the
output dir or specified in the builder.

If a signed enclave is not found, it will try to combine a pre-staged signature, pubkey,
generated data, and unsigned enclave.

If the signature, pubkey, or generated data do not exist, it will generate a new private
key and sign an unsigned enclave.

If an unsigned enclave does not exist, it will build it.
This method will extract the signature from a signed enclave sigstruct dump . If the dump is not found it will try to extract one from a signed enclave either in the output dir or specified in the builder . If a signed enclave is not found it will try to combine a pre - staged signature pubkey generated data and unsigned enclave . If the signature pubkey or generated data do not exist it will generate a new private key and sign an unsigned enclave . If an unsigned enclave does not exist it will build it .
pub fn build(&mut self) -> Result<Signature, Error> {
        // Emit correct "rerun-if-changed" diagnostics for cargo
        for package in self.staticlib.packages.iter() {
            // source.is_none implies a local package not from crates.io
            if package.source.is_none() {
                // package.manifest_path has form foo/Cargo.toml, we want to take parent
                // so that we walk the directory containing Cargo.toml
                package.manifest_path.parent().map(rerun_if_path_changed);
            }
        }
        let css_path = if let Some(css) = &self.css {
            rerun_if_changed!(css.as_os_str().to_str().expect("Invalid UTF-8 in CSS path"));
            css.canonicalize()?
        } else {
            let mut css_path = self.out_dir.join(&self.name);
            css_path.set_extension("css");
            self.create_css(&css_path)?;
            css_path
        };
        rustc_env!(
            "MCBUILD_ENCLAVE_CSS_PATH",
            "{}",
            css_path
                .as_os_str()
                .to_str()
                .expect("Invalid UTF-8 in CSS path")
        );
        let retval = Signature::try_from(fs::read(&css_path)?.as_slice())?;
        // Treat the CSS file as an artifact for future builds
        let mut artifact = self.profile_target_dir.join(&self.name);
        artifact.set_extension("css");
        if css_path != artifact {
            fs::copy(&css_path, artifact)?;
        }
        Ok(retval)
    }
pub fn build ( & mut self ) -> Result < Signature , Error > { // Emit correct "rerun-if-changed" diagnostics for cargo for package in self . staticlib . packages . iter ( ) { // source.is_none implies a local package not from crates.io if package . source . is_none ( ) { // package.manifest_path has form foo/Cargo.toml, we want to take parent // so that we walk the directory containing Cargo.toml package . manifest_path . parent ( ) . map ( rerun_if_path_changed ) ; } } let css_path = if let Some ( css ) = & self . css { rerun_if_changed ! ( css as_os_str ( ) to_str ( ) expect ( " " ) ) ; css . canonicalize ( ) ? } else { let mut css_path = self . out_dir . join ( & self . name ) ; css_path . set_extension ( " " ) ; self . create_css ( & css_path ) ? ; css_path } ; rustc_env ! ( " " " " css_path as_os_str ( ) to_str ( ) expect ( " " ) ) ; let retval = Signature :: try_from ( fs :: read ( & css_path ) ? . as_slice ( ) ) ? ; // Treat the CSS file as an artifact for future builds let mut artifact = self . profile_target_dir . join ( & self . name ) ; artifact . set_extension ( " " ) ; if css_path != artifact { fs :: copy ( & css_path , artifact ) ? ; } Ok ( retval ) }
This method will extract the signature from a signed enclave sigstruct dump.
This method will extract the signature from a signed enclave sigstruct dump .
&mut self
&mut self