How do I port php's openssl_sign to C#?
<p>I need to translate the following code to C# from php. What libraries / namespaces do I need to use?</p>

<pre><code>function sign($method, $uuid, $data) {
    $merchant_private_key = openssl_get_privatekey(file_get_contents('merchant_private_key.pem'));
    $plaintext = $method . $uuid . serialize_data($data);
    **openssl_sign($plaintext, $signature, $merchant_private_key);**
    return base64_encode($signature);
}
</code></pre>

<p>The api can be found over at <a href="http://php.net/manual/en/function.openssl-sign.php" rel="nofollow">http://php.net/manual/en/function.openssl-sign.php</a>. Where do I start? I have no idea what the open_ssl sign in php does behind the covers.</p>

<p>Anyone able to help out that knows both php and C# or could someone at least explain what openssl_sign does in the background so that I can port it.</p>

<p><strong>EDIT: 2010-08-18</strong> I can't find a way to use openssl, it keeps saying it can't load managedopenssl.dll. Think it is because of my machine being x64. </p>
