fn hkdf_sha256(
        &mut self,
        salt: &Box<dyn Secret>,
        info: &[u8],
        ikm: Option<&Box<dyn Secret>>,
        output_attributes: Vec<SecretAttributes>,
    ) -> OckamResult<Vec<Box<dyn Secret>>> {
        let ikm = match ikm {
            Some(secret) => Some(Self::get_entry_map(&self.map, secret)?),
            None => None,
        };
        let salt_context = Self::get_entry_map(&self.map, salt)?;

        self.v
            .hkdf_sha256(salt_context, info, ikm, output_attributes)?
            .into_iter()
            .map(|secret| {
                let id = self.add_secret(secret);
                // TODO: What if result is persistent?
                // TODO: Should we remove it

                let res: Box<dyn Secret> = Box::new(FilesystemVaultSecret(id));
                Ok(res)
            })
            .collect()
    }
/// Compute the HKDF-SHA256 using the specified salt and input key material
///
/// and return the output key material of the specified length
Compute the HKDF-SHA256 using the specified salt and input key material
and return the output key material of the specified length
Compute the HKDF - SHA256 using the specified salt and input key material and return the output key material of the specified length
fn hkdf_sha256(
        &mut self,
        salt: &Box<dyn Secret>,
        info: &[u8],
        ikm: Option<&Box<dyn Secret>>,
        output_attributes: Vec<SecretAttributes>,
    ) -> OckamResult<Vec<Box<dyn Secret>>> {
        let ikm = match ikm {
            Some(secret) => Some(Self::get_entry_map(&self.map, secret)?),
            None => None,
        };
        let salt_context = Self::get_entry_map(&self.map, salt)?;
        self.v
            .hkdf_sha256(salt_context, info, ikm, output_attributes)?
            .into_iter()
            .map(|secret| {
                let id = self.add_secret(secret);
                // TODO: What if result is persistent?
                // TODO: Should we remove it
                let res: Box<dyn Secret> = Box::new(FilesystemVaultSecret(id));
                Ok(res)
            })
            .collect()
    }
fn hkdf_sha256 ( & mut self , salt : & Box < dyn Secret > , info : & [ u8 ] , ikm : Option < & Box < dyn Secret > > , output_attributes : Vec < SecretAttributes > , ) -> OckamResult < Vec < Box < dyn Secret > > > { let ikm = match ikm { Some ( secret ) => Some ( Self :: get_entry_map ( & self . map , secret ) ? ) , None => None , } ; let salt_context = Self :: get_entry_map ( & self . map , salt ) ? ; self . v . hkdf_sha256 ( salt_context , info , ikm , output_attributes ) ? . into_iter ( ) . map ( | secret | { let id = self . add_secret ( secret ) ; // TODO: What if result is persistent? // TODO: Should we remove it let res : Box < dyn Secret > = Box :: new ( FilesystemVaultSecret ( id ) ) ; Ok ( res ) } ) . collect ( ) }
Compute the HKDF-SHA256 using the specified salt and input key material
and return the output key material of the specified length
Compute the HKDF - SHA256 using the specified salt and input key material and return the output key material of the specified length
&mut self
salt
&Box<dyn Secret>
info
&[u8]
ikm
Option<&Box<dyn Secret>>
output_attributes
Vec<SecretAttributes>
&mut self
salt
&Box<dyn Secret>
info
&[u8]
ikm
Option<&Box<dyn Secret>>
output_attributes
Vec<SecretAttributes>