pub fn nacl_secret_box_open(
    _context: std::sync::Arc<ClientContext>,
    params: ParamsOfNaclSecretBoxOpen,
) -> ClientResult<ResultOfNaclBoxOpen> {
    let (mut padded_output, padded_input, nonce, key) = prepare_to_convert(
        &base64_decode(&params.encrypted)?,
        &hex_decode(&params.nonce)?,
        &hex_decode(&params.key)?,
        16,
    )?;

    sodalite::secretbox_open(&mut padded_output, &padded_input, &nonce, &key)
        .map_err(|_| crypto::Error::nacl_secret_box_failed("secret box open failed"))?;
    padded_output.drain(..32);
    Ok(ResultOfNaclBoxOpen {
        decrypted: base64::encode(&padded_output),
    })
}
/// Decrypts and verifies cipher text using `nonce` and secret `key`.
Decrypts and verifies cipher text using `nonce` and secret `key`.
Decrypts and verifies cipher text using ` nonce ` and secret ` key ` .
pub fn nacl_secret_box_open(
    _context: std::sync::Arc<ClientContext>,
    params: ParamsOfNaclSecretBoxOpen,
) -> ClientResult<ResultOfNaclBoxOpen> {
    let (mut padded_output, padded_input, nonce, key) = prepare_to_convert(
        &base64_decode(&params.encrypted)?,
        &hex_decode(&params.nonce)?,
        &hex_decode(&params.key)?,
        16,
    )?;
    sodalite::secretbox_open(&mut padded_output, &padded_input, &nonce, &key)
        .map_err(|_| crypto::Error::nacl_secret_box_failed("secret box open failed"))?;
    padded_output.drain(..32);
    Ok(ResultOfNaclBoxOpen {
        decrypted: base64::encode(&padded_output),
    })
}
pub fn nacl_secret_box_open ( _context : std :: sync :: Arc < ClientContext > , params : ParamsOfNaclSecretBoxOpen , ) -> ClientResult < ResultOfNaclBoxOpen > { let ( mut padded_output , padded_input , nonce , key ) = prepare_to_convert ( & base64_decode ( & params . encrypted ) ? , & hex_decode ( & params . nonce ) ? , & hex_decode ( & params . key ) ? , 16 , ) ? ; sodalite :: secretbox_open ( & mut padded_output , & padded_input , & nonce , & key ) . map_err ( | _ | crypto :: Error :: nacl_secret_box_failed ( " " ) ) ? ; padded_output . drain ( .. 32 ) ; Ok ( ResultOfNaclBoxOpen { decrypted : base64 :: encode ( & padded_output ) , } ) }
Decrypts and verifies cipher text using `nonce` and secret `key`.
Decrypts and verifies cipher text using ` nonce ` and secret ` key ` .
_context
std::sync::Arc<ClientContext>
params
ParamsOfNaclSecretBoxOpen