Jak wypełnić wartość RSAParameters w c #

Użyłem poniższego kodu do szyfrowania w moim projekcie i wszystko działało dobrze.

RSACryptoServiceProvider x_alg = new RSACryptoServiceProvider(  );

// export only the public key 
RSAParameters x_public_params = x_alg.ExportParameters(false);

// export the private key 
RSAParameters x_private_params = x_alg.ExportParameters(true);

Teraz klient zmienił wymaganie i chce zapisać wszystkie wartości RSAParameters w pliku konfiguracyjnym i podać poniżej szczegóły demo

<project name="netCard Server1">
  <key length="256"></key>
  <D length="64">00000000000000000000000000000000000000000000000000000000000019C5</D>
  <DP length="32">00000000000000000000000000000061</DP>
  <DQ length="32">00000000000000000000000000000065</DQ>
  <Exponent length="6">000DCD</Exponent>
  <InverseQ length="32">0000000000000000000000000000003B</InverseQ>
  <Modulus length="64">0000000000000000000000000000000000000000000000000000000000002C95</Modulus>
  <P length="32">00000000000000000000000000000065</P>
  <Q length="32">00000000000000000000000000000071</Q>
  <text length ="64">0123456789ABCDEF111111111111111125FE2222222222222233333333334444</text>
  <cipher length ="64">0000000000000000000000000000000000000000000000000000000000000000</cipher>
</project>

Teraz problem polega na tym, że podczas importowania wartości RSAParameters otrzymuję wyjątek Bad Data

questionAnswers(2)

yourAnswerToTheQuestion