Generate a self-signed root certificate:</p>

<pre><code>openssl req -x509 -newkey rsa:2048 -keyout key.pem -out req.pem</code></pre>

<p>Create an SM2 private key and then generate a certificate request from it:</p>

<pre><code>openssl ecparam -genkey -name SM2 -out sm2.key
openssl req -new -key sm2.key -out sm2.csr -sm3 -sigopt &quot;distid:1234567812345678&quot;</code></pre>

<p>Examine and verify an SM2 certificate request:</p>

<pre><code>openssl req -verify -in sm2.csr -sm3 -vfyopt &quot;distid:123456