title: c# equivalent of "java.security.spec.RSAPublicKeySpec" and "java.security.PublicKey"
body: <p>I'm developing a new version in c# of an existing java application.</p>
  
  <p>The existing application uses RSA encryption with java.security.spec.* and boncycastle api.</p>
  
  <p>I'm looking for equivalent code in c# for the java below code: </p>
  
  <pre><code>public static java.security.PublicKey getKey
  (
  org.bouncycastle.asn1.x509.RSAPublicKeyStructure  rsaPublicKey
  )
  {
  
  java.security.KeyFactory keyFactory = KeyFactory.getInstance("RSA");
  
   java.security.spec.RSAPublicKeySpec keySpec = new RSAPublicKeySpec(
  rsaPublicKey.getModulus(), 
  rsaPublicKey.getPublicExponent());
  
  java.security.PublicKey pkey = keyFactory.generatePublic(keySpec);
  
  return pkey;
  }
  </code></pre>
  
  <p>I "googled" a lot but don't found solution. </p>
  
  <p>Thanks in advance for your help.</p>