'Decrypt using RSA private key using windows crypto api

I have a RSA private key in xml format.

<?xml version="1.0" encoding="utf-16"?>
<RSAParameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <Exponent>....</Exponent>
    <Modulus>....</Modulus>
    <P>....</P>
    <Q>....</Q>
    <DP>....</DP>
    <DQ>....</DQ>
    <InverseQ>....</InverseQ>
    <D>....</D>
</RSAParameters>

I have to decrypt some data in C++. I want to use Windows Crypto API in C++. I am new into C++ and crypto. Cannot find any good sample code for this. I am finding MSDN documentation a bit not for beginners. All I need is a set of library functions to read my private key from XML and decrypt some data. In C#, it is very straightforward. Don't understand why so complicated in C++. Can anyone help me with the steps or sample codes or some beginner level resources for this.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source