pub fn sign(mut self, key: &P256KeyPair) -> Result<Self, Error> {
        // The data that appears to be signed is the raw app image, with the
        // app properties already pointing to the new signature position, but
        // not including the space allocated for that signature.

        let sig_pos = self.make_ecdsa_signature_space() as usize;

        let signature = crypto::create_signature(key, &self.raw[..sig_pos])?;
        self.raw.0.to_mut()[sig_pos..sig_pos + 64].copy_from_slice(&signature);

        Ok(self)
    }
/// Signs this application image.
///
/// The signature will be embedded into the flashed data, and the
/// application properties structure will be updated to point at the
/// signature. If the signature pointer is non-zero and the signature type
/// indicates an ECDSA P-256 signature, an existing signature is assumed to
/// be present at that offset and will be overwritten with a new signature.
///
/// If no signature is present, this will append the new signature to the
/// raw image, enlarging it.
///
/// If secure boot is enabled in the bootloader, a valid signature must be
/// present for boot to continue.
///
/// # Errors
///
/// Returns an error if there is a problem accessing the system's random
/// number generator.
Signs this application image.
The signature will be embedded into the flashed data, and the
application properties structure will be updated to point at the
signature. If the signature pointer is non-zero and the signature type
indicates an ECDSA P-256 signature, an existing signature is assumed to
be present at that offset and will be overwritten with a new signature.

If no signature is present, this will append the new signature to the
raw image, enlarging it.

If secure boot is enabled in the bootloader, a valid signature must be
present for boot to continue.
Signs this application image . The signature will be embedded into the flashed data and the application properties structure will be updated to point at the signature . If the signature pointer is non - zero and the signature type indicates an ECDSA P - 256 signature an existing signature is assumed to be present at that offset and will be overwritten with a new signature . If no signature is present this will append the new signature to the raw image enlarging it . If secure boot is enabled in the bootloader a valid signature must be present for boot to continue .
pub fn sign(mut self, key: &P256KeyPair) -> Result<Self, Error> {
        // The data that appears to be signed is the raw app image, with the
        // app properties already pointing to the new signature position, but
        // not including the space allocated for that signature.
        let sig_pos = self.make_ecdsa_signature_space() as usize;
        let signature = crypto::create_signature(key, &self.raw[..sig_pos])?;
        self.raw.0.to_mut()[sig_pos..sig_pos + 64].copy_from_slice(&signature);
        Ok(self)
    }
pub fn sign ( mut self , key : & P256KeyPair ) -> Result < Self , Error > { // The data that appears to be signed is the raw app image, with the // app properties already pointing to the new signature position, but // not including the space allocated for that signature. let sig_pos = self . make_ecdsa_signature_space ( ) as usize ; let signature = crypto :: create_signature ( key , & self . raw [ .. sig_pos ] ) ? ; self . raw . 0 . to_mut ( ) [ sig_pos .. sig_pos + 64 ] . copy_from_slice ( & signature ) ; Ok ( self ) }
Signs this application image.
Signs this application image .
mut self
key
&P256KeyPair
errors
Returns an error if there is a problem accessing the system's random
number generator.
Returns an error if there is a problem accessing the system ' s random number generator .