/// Constructs a new VBMeta using the provided `descriptors` and AVB `key`.
/// This can fail if signing with `key` failed.
Constructs a new VBMeta using the provided `descriptors` and AVB `key`.
This can fail if signing with `key` failed.
Constructs a new VBMeta using the provided ` descriptors ` and AVB ` key ` . This can fail if signing with ` key ` failed .
pub fn try_new(descriptors: Vec<HashDescriptor>, key: Key) -> Result<Self, SignFailure> {
        let mut header = Header::default();
        let aux_data = generate_aux_data(&mut header, &descriptors, &key);
        let auth_data = generate_auth_data(&mut header, &key, &aux_data)?;
        let mut bytes: Vec<u8> = Vec::new();
        bytes.extend_from_slice(header.as_bytes());
        bytes.extend_from_slice(&auth_data);
        bytes.extend_from_slice(&aux_data);
        Ok(VBMeta { bytes, _header: header, _descriptors: descriptors, _key: key })
    }
pub fn try_new ( descriptors : Vec < HashDescriptor > , key : Key ) -> Result < Self , SignFailure > { let mut header = Header :: default ( ) ; let aux_data = generate_aux_data ( & mut header , & descriptors , & key ) ; let auth_data = generate_auth_data ( & mut header , & key , & aux_data ) ? ; let mut bytes : Vec < u8 > = Vec :: new ( ) ; bytes . extend_from_slice ( header . as_bytes ( ) ) ; bytes . extend_from_slice ( & auth_data ) ; bytes . extend_from_slice ( & aux_data ) ; Ok ( VBMeta { bytes , _header : header , _descriptors : descriptors , _key : key } ) }
Constructs a new VBMeta using the provided `descriptors` and AVB `key`.
Constructs a new VBMeta using the provided ` descriptors ` and AVB ` key ` .
descriptors
Vec<HashDescriptor>
key
Key