fn rsgx_create_rsa_priv1_key()

in sgx_tcrypto/src/crypto.rs [3514:3547]


fn rsgx_create_rsa_priv1_key(
    n_size: i32,
    e_size: i32,
    d_size: i32,
    n: &[u8],
    e: &[u8],
    d: &[u8],
    new_pri_key: &mut sgx_rsa_key_t,
) -> sgx_status_t {
    if (n_size <= 0) || (e_size <= 0) || (d_size <= 0) {
        return sgx_status_t::SGX_ERROR_INVALID_PARAMETER;
    }
    if (n.is_empty()) || (n.len() > i32::MAX as usize) {
        return sgx_status_t::SGX_ERROR_INVALID_PARAMETER;
    }
    if (e.is_empty()) || (e.len() > i32::MAX as usize) {
        return sgx_status_t::SGX_ERROR_INVALID_PARAMETER;
    }
    if (d.is_empty()) || (d.len() > i32::MAX as usize) {
        return sgx_status_t::SGX_ERROR_INVALID_PARAMETER;
    }

    unsafe {
        sgx_create_rsa_priv1_key(
            n_size,
            e_size,
            d_size,
            n.as_ptr(),
            e.as_ptr(),
            d.as_ptr(),
            new_pri_key as *mut sgx_rsa_key_t,
        )
    }
}