pub fn unseal(sealed_log_in: &mut [u8]) -> Result<Option<Self>, EnclaveError> {
        let sealed_log_size: usize = SEAL_LOG_SIZE;
        let sealed_log = sealed_log_in.as_mut_ptr();
        let sealed_data = match from_sealed_log::<Self>(sealed_log, sealed_log_size as u32) {
            Some(data) => data,
            None => {
                return Err(SystemError(OcallError { command: "unseal".to_string(), err: "No data in sealed log".to_string() }));
            }
        };
        let unsealed_result = sealed_data.unseal_data();
        match unsealed_result {
            Ok(unsealed_data) => {
                let mut udata = unsealed_data.get_decrypt_txt();
                Ok(Some(*udata))
            }
            Err(err) => {
                // TODO: Handle this. It can causes panic in Simulation Mode until deleting the file.
                if err != sgx_status_t::SGX_ERROR_MAC_MISMATCH {
                    return Err(SystemError(OcallError { command: "unseal".to_string(), err: format!("{:?}", err) }));
                }
                Ok(None)
            }
        }
    }
/// Unseal sealed log
/// param: sealed_log_in : the encrypted blob
Unseal sealed log
param: sealed_log_in : the encrypted blob
Unseal sealed log param : sealed_log_in : the encrypted blob
pub fn unseal(sealed_log_in: &mut [u8]) -> Result<Option<Self>, EnclaveError> {
        let sealed_log_size: usize = SEAL_LOG_SIZE;
        let sealed_log = sealed_log_in.as_mut_ptr();
        let sealed_data = match from_sealed_log::<Self>(sealed_log, sealed_log_size as u32) {
            Some(data) => data,
            None => {
                return Err(SystemError(OcallError { command: "unseal".to_string(), err: "No data in sealed log".to_string() }));
            }
        };
        let unsealed_result = sealed_data.unseal_data();
        match unsealed_result {
            Ok(unsealed_data) => {
                let mut udata = unsealed_data.get_decrypt_txt();
                Ok(Some(*udata))
            }
            Err(err) => {
                // TODO: Handle this. It can causes panic in Simulation Mode until deleting the file.
                if err != sgx_status_t::SGX_ERROR_MAC_MISMATCH {
                    return Err(SystemError(OcallError { command: "unseal".to_string(), err: format!("{:?}", err) }));
                }
                Ok(None)
            }
        }
    }
pub fn unseal ( sealed_log_in : & mut [ u8 ] ) -> Result < Option < Self > , EnclaveError > { let sealed_log_size : usize = SEAL_LOG_SIZE ; let sealed_log = sealed_log_in . as_mut_ptr ( ) ; let sealed_data = match from_sealed_log :: < Self > ( sealed_log , sealed_log_size as u32 ) { Some ( data ) => data , None => { return Err ( SystemError ( OcallError { command : " " . to_string ( ) , err : " " . to_string ( ) } ) ) ; } } ; let unsealed_result = sealed_data . unseal_data ( ) ; match unsealed_result { Ok ( unsealed_data ) => { let mut udata = unsealed_data . get_decrypt_txt ( ) ; Ok ( Some ( * udata ) ) } Err ( err ) => { // TODO: Handle this. It can causes panic in Simulation Mode until deleting the file. if err != sgx_status_t :: SGX_ERROR_MAC_MISMATCH { return Err ( SystemError ( OcallError { command : " " . to_string ( ) , err : format ! ( " " err ) } ) ) ; } Ok ( None ) } } }
Unseal sealed log
param: sealed_log_in : the encrypted blob
Unseal sealed log param : sealed_log_in : the encrypted blob
sealed_log_in
&mut [u8]
sealed_log_in
&mut [u8]